Marcelo,<br><br>Opções existem aos montes, mas a minha recomendação é KISS Ever !!! Se o que você tem são scripts de linha de comando, eu recomendo fortemente o Getopt::Long (que é core no Perl). Um bom exemplo que utilização deste cara seria assim : <br>

<br><span style="font-family: courier new,monospace;">&lt;code&gt;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">#!/usr/bin/env perl</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">use Getopt::Long;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">use strict;</span><br style="font-family: courier new,monospace;">

<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">my $VERSION  = &#39;0.03&#39;;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">my %ERRORS   = ( &#39;OK&#39; =&gt; 0, &#39;WARNING&#39;=&gt; 1, &#39;CRITICAL&#39;=&gt; 2, &#39;UNKNOWN&#39;=&gt;3, &#39;DEPENDENT&#39;=&gt;4 );</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">my %CONFIG;</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Getopt::Long::Configure(&#39;bundling&#39;);</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">GetOptions (</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    &quot;v|version&quot;    =&gt; sub { show_version() } ,</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">    &quot;h|help&quot;       =&gt; sub { show_help() }    ,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    &quot;H|host=s&quot;     =&gt; \$CONFIG{&#39;hostname&#39;}   ,</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">    &quot;w|warning=s&quot;  =&gt; \$CONFIG{&#39;warning&#39;}    ,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    &quot;c|critical=s&quot; =&gt; \$CONFIG{&#39;critical&#39;}   ,</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">    &quot;d|disk=s&quot;     =&gt; \$CONFIG{&#39;disk&#39;}       ,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  );</span><br style="font-family: courier new,monospace;">

<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&lt;/code&gt;</span><br style="font-family: courier new,monospace;"><br>Como você pode ver, já recebo os parâmetros e armazeno num hash. E este cara pode fazer muitas outras coisas, como armazenar várias opnções para o mesmo parâmetros, tipo : &#39;<span style="font-family: courier new,monospace;">--dir /etc  --dir /home/mane --dir /var/log</span>&#39; e no programa podemos ter isto assim : &#39; <span style="font-family: courier new,monospace;">&quot;dir=s&quot; =&gt; \@{$CONFIG{&#39;dir&#39;}</span>&#39;.<br>

<br>Desta maneira o teu script não precisa ter preocupações relativas a manipulação de arquivos externo a ele.<br><br>Seguindo a linha KISS, eviter os arquivos de configurações em formatos JSON, XML, YAML a menos que o teu programa vá utilizar estes formatos em outra coisa. Pois os módulos Config* para estes formatos carregam outras dependências apenas para estes caras, e não vale a penas colocar mais código dependência se você não for utilizar para outra coisa.<br>

<br>Abraços,<br><br>Solli M. Honorio <br><br><br><div class="gmail_quote">Em 17 de fevereiro de 2011 23:06, Marcelo Gigliotti <span dir="ltr">&lt;<a href="mailto:marcelo.gigliotti@gmail.com">marcelo.gigliotti@gmail.com</a>&gt;</span> escreveu:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Seria algo bem simples... eu costumo desenvolver diversos scripts pra<br>
automação de servidores onde trabalho e eu notei que pra cada, eu<br>
costumo declarar as mesmas variaveis, tais como, diretório de logs,<br>
ips de rede, usuários, senhas, etc... e penso que seria muito mais<br>
fácil se eu criasse um arquivo estatico com estas informações do que<br>
ficar declarando as mesmas diversas vezes.<br>
<br>
eu achei um módulo que atende perfeitamente as minhas necessidades,<br>
mas eu gostaria de tentar algo sem precisar de bibliotecas<br>
adicionais...<br>
<br>
<a href="http://search.cpan.org/%7Esherzodr/Config-Simple-4.59/Simple.pm" target="_blank">http://search.cpan.org/~sherzodr/Config-Simple-4.59/Simple.pm</a><br>
<div class="im"><br>
<br>
Atenciosamente<br>
Marcelo Gigliotti<br>
Analista de Suporte<br>
Red Hat Certified Technician<br>
<a href="http://www.tabugado.com" target="_blank">www.tabugado.com</a><br>
Msn: <a href="mailto:tchelllo@hotmail.com">tchelllo@hotmail.com</a><br>
Linux User: #392364<br>
<br>
<br>
<br>
</div><div class="im">2011/2/17 Daniel de Oliveira Mantovani &lt;<a href="mailto:daniel.oliveira.mantovani@gmail.com">daniel.oliveira.mantovani@gmail.com</a>&gt;:<br>
</div><div><div></div><div class="h5">&gt; Depende muito do problema. Um arquivo de configuração resolve vários<br>
&gt; problemas, normalmente ajuda a definir dados estatíscos que servirão<br>
&gt; de parâmetro para uma seqüência.<br>
&gt; Existe o Config::Any[0] que carrega configuração de diferentes<br>
&gt; formatos de arquivo, o interlocutor poderá se aventurar lendo a<br>
&gt; documentação.<br>
&gt;<br>
&gt; Um arquivo de configuração é só uma mídia, você não precisa abstrair<br>
&gt; isso necessariamente num formato como XML e JSON.<br>
&gt; Para um diagnostico, precisa-se do conhecimento do ser[1], e isso só é<br>
&gt; possível quando o apresenta. Por isso eu peço que nos fale mais sobre<br>
&gt; o seu problema.<br>
&gt;<br>
&gt; [0]<a href="http://search.cpan.org/%7Ebricas/Config-Any-0.20/lib/Config/Any.pm" target="_blank">http://search.cpan.org/~bricas/Config-Any-0.20/lib/Config/Any.pm</a><br>
&gt; [1]<a href="http://pt.wikipedia.org/wiki/Diagn%C3%B3stico" target="_blank">http://pt.wikipedia.org/wiki/Diagn%C3%B3stico</a><br>
&gt;<br>
&gt; 2011/2/17 Tiago Peczenyj &lt;<a href="mailto:tiago.peczenyj@gmail.com">tiago.peczenyj@gmail.com</a>&gt;:<br>
&gt;&gt; Pessoalmente eu gosto de carregar um hash ou hashref chamado conf ou<br>
&gt;&gt; algo do tipo e, então, acessar as informações a partir dessa variavel.<br>
&gt;&gt;<br>
&gt;&gt; 2011/2/17 Marcelo Gigliotti &lt;<a href="mailto:marcelo.gigliotti@gmail.com">marcelo.gigliotti@gmail.com</a>&gt;:<br>
&gt;&gt;&gt; Srs,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; andei pesquisando sobre carregar arquivo com variaveis com o objetivo<br>
&gt;&gt;&gt; de ganhar tempo em diversos scripts que venho desenvolvendo e também<br>
&gt;&gt;&gt; com o objetivo de centralizar todas as minhas informações estaticas.<br>
&gt;&gt;&gt; Encontrei uma lib (Config::Inifiles), mas gostaria de saber a opinião<br>
&gt;&gt;&gt; de vocês sobre outros metodos ou se esta é a melhor opção.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Atenciosamente<br>
&gt;&gt;&gt; Marcelo Gigliotti<br>
&gt;&gt;&gt; Analista de Suporte<br>
&gt;&gt;&gt; Red Hat Certified Technician<br>
&gt;&gt;&gt; <a href="http://www.tabugado.com" target="_blank">www.tabugado.com</a><br>
&gt;&gt;&gt; Msn: <a href="mailto:tchelllo@hotmail.com">tchelllo@hotmail.com</a><br>
&gt;&gt;&gt; Linux User: #392364<br>
&gt;&gt;&gt; =begin disclaimer<br>
&gt;&gt;&gt;   Sao Paulo Perl Mongers: <a href="http://sao-paulo.pm.org/" target="_blank">http://sao-paulo.pm.org/</a><br>
&gt;&gt;&gt;  SaoPaulo-pm mailing list: <a href="mailto:SaoPaulo-pm@pm.org">SaoPaulo-pm@pm.org</a><br>
&gt;&gt;&gt;  L&lt;<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a>&gt;<br>
&gt;&gt;&gt; =end disclaimer<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Tiago B. Peczenyj<br>
&gt;&gt; Linux User #405772<br>
&gt;&gt;<br>
&gt;&gt; <a href="http://pacman.blog.br" target="_blank">http://pacman.blog.br</a><br>
&gt;&gt; =begin disclaimer<br>
&gt;&gt;   Sao Paulo Perl Mongers: <a href="http://sao-paulo.pm.org/" target="_blank">http://sao-paulo.pm.org/</a><br>
&gt;&gt;  SaoPaulo-pm mailing list: <a href="mailto:SaoPaulo-pm@pm.org">SaoPaulo-pm@pm.org</a><br>
&gt;&gt;  L&lt;<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a>&gt;<br>
&gt;&gt; =end disclaimer<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; &quot;If you’ve never written anything thoughtful, then you’ve never had<br>
&gt; any difficult, important, or interesting thoughts. That’s the secret:<br>
&gt; people who don’t write, are people who don’t think.&quot;<br>
&gt; =begin disclaimer<br>
&gt;   Sao Paulo Perl Mongers: <a href="http://sao-paulo.pm.org/" target="_blank">http://sao-paulo.pm.org/</a><br>
&gt;  SaoPaulo-pm mailing list: <a href="mailto:SaoPaulo-pm@pm.org">SaoPaulo-pm@pm.org</a><br>
&gt;  L&lt;<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a>&gt;<br>
&gt; =end disclaimer<br>
&gt;<br>
=begin disclaimer<br>
   Sao Paulo Perl Mongers: <a href="http://sao-paulo.pm.org/" target="_blank">http://sao-paulo.pm.org/</a><br>
 SaoPaulo-pm mailing list: <a href="mailto:SaoPaulo-pm@pm.org">SaoPaulo-pm@pm.org</a><br>
 L&lt;<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a>&gt;<br>
=end disclaimer<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>&quot;o animal satisfeito dorme&quot;. - Guimarães Rosa<br>