<div dir="ltr"><div>Olá Nicole!</div><div>Já passei por situação semelhante à sua, quando não podia atualizar o Perl default do sistema e a opção foi instalar um Perl mais atualizado avulso no /usr/local. Para sempre usar o Perl do /usr/local, 3 medidas foram tomadas:</div>

<div><br></div><div>1. export PATH=/usr/local/bin:$PATH</div><div><br></div><div>2. Os shebangs de todos os scripts executáveis do projeto foram modificados de:</div><div><br></div><div>#!/usr/bin/perl</div><div><br></div>

<div>para:</div><div><br></div><div>#!/usr/bin/env perl</div><div><br></div><div>3. local::lib foi utilizado para CPAN "desovar" no $HOME. O local::lib requer uma intervenção do .profile do sistema, para inicializar o environment apropriadamente. Seguem os passos para instalar o local::lib dessa forma.</div>

<div><br></div><div>3.1. Download do local::lib:</div><div><br></div><div>$ wget <a href="http://cpan.metacpan.org/authors/id/H/HA/HAARG/local-lib-2.000004.tar.gz">http://cpan.metacpan.org/authors/id/H/HA/HAARG/local-lib-2.000004.tar.gz</a></div>

<div>$ tar xzvf local-lib-2.000004.tar.gz</div><div>$ cd local-lib-2.000004/</div><div><br></div><div>3.2. Instalação do local::lib:</div><div><br></div><div>$ perl Makefile.PL --bootstrap=$HOME/perl5</div><div>$ make</div>

<div>$ make test</div><div>$ make install</div><div><br></div><div>3.3. Ativando local::lib na inicialização da shell (Bash):</div><div><br></div><div>$ cat << PROFILE >> $HOME/.profile</div><div>eval \$(perl -I\$HOME/perl5/lib/perl5/ -Mlocal::lib)</div>

<div>PROFILE</div><div>$</div><div><br></div><div>A idéia aqui é que rodar "perl -I$HOME/perl5/lib/perl5/ -Mlocal::lib" retorna para STDOUT as tais das variáveis de ambiente que fazem o Perl buscar instalação dos módulos em um lugar específico ($HOME). Pode simplesmente colar essas variáveis direto no .profile, ou (como demonstrado acima) rodar eval do output do Perl.</div>

<div><br></div><div>3.4. Carregar a configuração:</div><div><br></div><div>. $HOME/.profile</div><div><br></div><div>3.5. Prosseguindo com a configuração/teste do CPAN e do cpanm (essa configuração faz as dependências serem instaladas automaticamente):</div>

<div><br></div><div>$ cpan</div><div><br></div><div>cpan[1]> o conf prerequisites_policy follow</div><div>cpan[2]> o conf commit</div><div>cpan[3]> install App::cpanminus</div><div>cpan[4]> quit</div><div><br>

</div><div>Boa sorte!</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-01-29 Nicole Scherer <span dir="ltr"><<a href="mailto:bionica2007-perl@yahoo.com" target="_blank">bionica2007-perl@yahoo.com</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:10pt;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif"><div>

<div><div style="font-size:10pt;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif"><div><div><div style="font-size:10pt;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">

<div><div><div style="font-size:10pt;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif"><div><div><div style="font-size:10pt;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">

<div><div><div style="font-size:10pt;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif"><div>Boa tarde, queridos Mongers,</div><div><br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">

eu não queria importuná-los com problemas simples,
 mas após três dias batendo a cabeça e vasculhando fóruns na internet sem solução para algumas das perguntas, recorro a vocês. Vou tentar explicar a novela.</div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">

<br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">Montamos um cluster HPC para pesquisa usando o Rocks 6.1
 (<a href="http://www.rocksclusters.org/" target="_blank">http://www.rocksclusters.org/</a>) -- um tipo de linux que instala outro linux em todos os nós do cluster e
 gerencia tudo isso. Novidade pra mim, mas funciona. Esse Rocks instala os chamados Rolls, entre eles o próprio SO (neste caso o RHEL6) e outros Rolls úteis, como SGE, Ganglia, Web-Server, Bio, Perl (4.14.2) entre outros. Estes Rolls são instalados em /opt/ e as vezes coexistem com os binários do SO. Desta forma, tenho duas versões de Perl:</div>

<div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif"><br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">

- a do sistema (RHEL6):<br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">$ /usr/bin/perl -v<br>This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi<br>

</div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif"><br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">

- e a do Rocks:</div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">$ /opt/perl/bin/perl -v<br>This is perl 5, version 14, subversion 2
 (v5.14.2) built for x86_64-linux-thread-multi</div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif"><br></div>

<div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">Cada qual com as suas bibliotecas.<br><br>  @INC:<br>   
 /usr/local/lib64/perl5<br>    /usr/local/share/perl5<br>   
 /usr/lib64/perl5/vendor_perl<br>    /usr/share/perl5/vendor_perl<br>    /usr/lib64/perl5<br>   
 /usr/share/perl5<br>    .<br>  @INC:<br>    /opt/perl/lib/site_perl/5.14.2/x86_64-linux-thread-multi<br>    /opt/perl/lib/site_perl/5.14.2<br>    /opt/perl/lib/5.14.2/x86_64-linux-thread-multi<br>   
 /opt/perl/lib/5.14.2<br>    .<br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif"><br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">

<br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">Agora é que começam meus problemas...</div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">

<br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">Primeiro: Alguém já teve
 experiência com duas instalações coexistentes de Perl? Posso ter problemas de funcionamento no SO se eu
 mover  o  /usr/bin/perl e criar um link do  /opt/perl/bin/perl para   /usr/bin/perl  (uma vez que as shebang dos scripts costuma ter este endereço). Colocar simplesmente /opt/perl/bin no início do $PATH pode não ser a solução. <br>

<br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif"><br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">

O CPAN só está instalado na versão do Rocks, o que me motiva mais a deixá-lo
 como default.</div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif"> Como a maioria dos usuários não terão privilégios de root e além disso, qualquer instalação no sistema operacional tem que ser espelhada para todos os nós, a melhor opção para instalar pacotes é na home dos usuários, concordam? Então eu quero deixar tudo o mais fácil
 possível para que os usuários instalem os pacotes desejados. Como não teremos acesso direto à internet usei o minicpan para criar um mirror em uma pasta compartilhada com minha máquina local. Configurei o urllist do cpan pra ela e ficou tudo ok.<br>

</div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">Agora esbarrei em um problema que não estou achando resposta fácil.</div>

<div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif"><br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">

Quando executo o cpan pela primeira vez como usuário comum, da forma mais
 automática possível, ele cria, como esperado o arquivo MyConfig.pm e toda a estrutura de diretórios no home do usuário. Ele executa quase tudo com perfeição, substituindo o endereço default pelo do usuário em QUASE todos os itens, menos em prefs_dir.<br>

</div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif"><br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">

[hpcst06@crab ~]$
 grep cpan .cpan/CPAN/MyConfig.pm<br>  'build_dir' => q[/home/hpcst06/.cpan/build],<br> 
 'cpan_home' => q[/home/hpcst06/.cpan],<br>  'histfile' => q[/home/hpcst06/.cpan/histfile],<br> 
 'keep_source_where' => q[/home/hpcst06/.cpan/sources],<br>  'prefs_dir' => q[/export/cpan/cpan/prefs],<br><br><br>(O default cpan_home é /export/cpan/cpan )<br>[hpcst06@crab ~]$ grep cpan /opt/perl/lib/5.14.2/CPAN/Config.pm<br>

  'build_dir' => q[/export/cpan/cpan/build],<br>  'cpan_home' => q[/export/cpan/cpan],<br>  'histfile' => q[/export/cpan/cpan/histfile],<br>  'keep_source_where' => q[/export/cpan/cpan/sources],<br>

  'prefs_dir' => q[/export/cpan/cpan/prefs],<br><br><br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">

Claro que o usuário pode
 executar</div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">>o conf prefs_dir /home/hpcst06/.cpan/prefs</div>

<div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">para alterar
 esta variável, mas concordam que deveria ter sido automático.</div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">

Alguém já passou por isto?</div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif"><br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">

Procurei o erro em FirstTime.pm, mas não consegui localizar algo que me chamasse a atenção.<br></div>Exatamente igual ao que tenho no Ubuntu, e que funciona normalmente.<br><br><br>- Tendo corrigido manualmente o prefs_dir, segui tentando instalar localmente algum pacote.<br>

Aí eu admito uma grande falta de conhecimento da minha parte, mas tentei entender o que os tutoriais na internet e
 fiquei
 perdida. Devo usar direto o cpan? (já que na configuração ele me pergunta se eu quero que use local::lib)<br>What approach do you want?  (Choose 'local::lib', 'sudo' or
 'manual')<br> [local::lib] <br>Ou devo usar sempre <br>$ perl -MCPAN -Mlocal::lib -e 'CPAN::install(Acme::Time::Baby)'<br>?<br>(tudo bem, posso
 colocar esta linha no tutorial, vai assustar os usuários, mas funciona)<br><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">

<br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif"><br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">

- Rodando<br>[hpcst06@crab ~]$ perl -MCPAN -Mlocal::lib -e 'CPAN::install(Acme::Time::Baby)'<br><br>- deu tudo certo.<br>[...]<br>Result: PASS<br>  ABIGAIL/Acme-Time-Baby-2010090301.tar.gz<br>  /usr/bin/make test -- OK<br>

Running make install<br>Prepending /home/hpcst06/.cpan/build/Acme-Time-Baby-2010090301-wJGXda/blib/arch
 /home/hpcst06/.cpan/build/Acme-Time-Baby-2010090301-wJGXda/blib/lib to
 PERL5LIB for 'install'<br>Installing /home/hpcst06/perl5/lib/perl5/Acme/Time/Baby.pm<br>Installing /home/hpcst06/perl5/man/man3/Acme::Time::Baby.3<br>Appending installation info to
 /home/hpcst06/perl5/lib/perl5/x86_64-linux-thread-multi/perllocal.pod<br>  ABIGAIL/Acme-Time-Baby-2010090301.tar.gz<br>  /usr/bin/make install  -- OK<br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">

<br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif"><br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">

- Agora, tentei instalar o Data::Printer (Oi Breno!) pela mesma estratégia e não consegui. Pode ser que não tenha a ver com a estratégia.<br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">

<br>Test Summary Report<br>-------------------<br>t/05-obj.t                (Wstat: 512 Tests: 0 Failed: 0)<br>  Non-zero exit status: 2<br>  Parse errors: No plan found in TAP output<br>t/06-obj2.t               (Wstat: 512 Tests: 0 Failed: 0)<br>

  Non-zero exit status: 2<br>  Parse errors: No plan found in TAP output<br>t/07-sort.t               (Wstat: 512 Tests: 1 Failed: 0)<br>  Non-zero exit status: 2<br>  Parse errors: No
 plan found in
 TAP output<br>t/25-weak.t               (Wstat: 512 Tests: 8 Failed: 0)<br>  Non-zero exit status: 2<br>  Parse errors: No plan found in TAP output<br>Files=54, Tests=258,  4 wallclock secs ( 0.19 usr  0.09 sys +  2.82 cusr  0.40 csys =  3.50 CPU)<br>

Result: FAIL<br>Failed 4/54 test programs. 0/258 subtests failed.<br>make: *** [test_dynamic] Error 255<br>  GARU/Data-Printer-0.35.tar.gz<br>  /usr/bin/make test -- NOT OK<br>//hint// to see the cpan-testers results for installing this module, try:<br>

  reports GARU/Data-Printer-0.35.tar.gz<br>Running make install<br>  make test had returned bad status, won't install without force<br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">

<br><br><br>Desculpem a postagem tão longa. Acabei até solucionando algumas outras dúvidas enquanto tentava descrevê-las aqui.<br><br>Abraços a todos,<br>Nicole Scherer<br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif">

<br></div><div style="font-style:normal;font-size:13.3333px;background-color:transparent;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif"><br></div></div></div></div></div></div></div></div>

</div></div></div></div></div></div></div></div></div></div><br>_______________________________________________<br>
Rio-pm mailing list<br>
<a href="mailto:Rio-pm@pm.org">Rio-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/rio-pm" target="_blank">http://mail.pm.org/mailman/listinfo/rio-pm</a><br></blockquote></div><br></div>