Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > a918147e816a04e85f8654f72077e879 > files > 106

perl-Libconf-0.42.10-6.mga4.x86_64.rpm

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@localhost" />
</head>

<body style="background-color: white">



<ul id="index">
  <li><a href="#NAME">NAME</a></li>
  <li><a href="#DESCRIPTION">DESCRIPTION</a></li>
  <li><a href="#SYNOPSIS">SYNOPSIS</a></li>
  <li><a href="#CONSTRUCTOR">CONSTRUCTOR</a></li>
  <li><a href="#GENERAL-METHODS">GENERAL METHODS</a></li>
  <li><a href="#SPECIFIC-METHODS">SPECIFIC METHODS</a></li>
</ul>

<h1 id="NAME">NAME</h1>

<p>Libconf::Templates::Shell - Libconf low level template for shell styles config files</p>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<p>Libconf::Templates::Shell is a template that handles the files that contain &#39;shell like&#39; informations.</p>

<h1 id="SYNOPSIS">SYNOPSIS</h1>

<pre><code> my $template = new Libconf::Templates::Shell({ filename =&gt; &#39;some_file&#39; });
 $template-&gt;read_conf();
 ...
 (see L&lt;Libconf::Templates&gt; for transformation methods on $template)
 ...
 $template_write_conf();</code></pre>

<h1 id="CONSTRUCTOR">CONSTRUCTOR</h1>

<dl>

<dt id="new-options"><b>new($options)</b></dt>
<dd>

<p>creates the template</p>

<pre><code>  $template = new Libconf::Templates::Shell({
                                                filename =&gt; &#39;some_file&#39;,
                                           })
  $template = new Libconf::Templates::Shell({
                                                filename =&gt; &#39;some_file&#39;,
                                                shell_style =&gt; &#39;true_bash&#39;,
                                                shell_command =&gt; &#39;/bin/bash&#39;,
                                                export_line =&gt; 1,
                                                export_only_defined =&gt; 1,
                                           })</code></pre>

<p><b>arguments</b></p>

<p>$options [<b>type</b> : HASH_REF] specifies the options to create the new template instance.</p>

<p><b>options</b></p>

<p>filename [<b>type</b> : STRING, <b>default</b> : &#39;&#39;] : the filename of the config file you want to work on. Can be read and written lately by using set_filename and get_filename.</p>

<p>shell_style [<b>type</b> : STRING, <b>default</b> : &#39;sh&#39;, <b>values</b>: &#39;sh&#39;, &#39;csh&#39;,&#39;true_bash&#39;] : specifies the shell type syntax to use. If &#39;sh&#39; is used, the key=value is used, if &#39;csh&#39; is used, the setenv key value is used. An example to transform a sh style config file to a csh one :</p>

<pre><code> my $template = new Libconf::Templates::Shell({ filename =&gt; &#39;some_file&#39; });
 $template-&gt;read_conf();
 $template-&gt;{shell_style} = &#39;csh&#39;;
 $template_write_conf();</code></pre>

<p>If &#39;true_bash&#39; is used, then the template will call the shell binary to interpret the values. If &#39;true_bash&#39; is set, then &#39;shell_command&#39; has to be set also</p>

<p>shell_command [<b>type</b> : STRING] : required if shell_style is set to true_bash. This will be used to call the shell binary. Examples : shell_command =&gt; &#39;/bin/bash&#39;. It will be used to interpret the values. It is useful when the values uses special bash command (like variable evaluation)</p>

<p>export_line [<b>type</b> : BOOLEAN, <b>default</b> : 0 ] : if true, and if applicable (shell_style = sh), a line will be added at the beginning of the file to export the defined variables in the file, like :</p>

<pre><code> export http_proxy ftp_proxy</code></pre>

<p>export_only_defined [<b>type</b> : BOOLEAN, <b>default</b> : 1 ] : if true, and if export_line is true, the added line will export only non void variables. If false, the added line will export all variables, even if they are void.</p>

</dd>
</dl>

<h1 id="GENERAL-METHODS">GENERAL METHODS</h1>

<p>See <a>Libconf::Templates</a> for the complete list of methods you can call on this template.</p>

<h1 id="SPECIFIC-METHODS">SPECIFIC METHODS</h1>

<p>There is no specific method</p>


</body>

</html>