[SP-pm] printenv em perl?

Daniel de Oliveira Mantovani daniel.oliveira.mantovani at gmail.com
Tue Jun 22 11:50:16 PDT 2010


2010/6/22 Otávio Fernandes <otaviof em gmail.com>:
> 2010/6/22 Daniel de Oliveira Mantovani <daniel.oliveira.mantovani em gmail.com>:
>>
>> Estava muito grande,
>>
>> perl -E 'say for keys%::'
>>
>> -4 :P
>
> Mantovani,
>
> O resultado desta expressão, não me parece nem um pouco com variáveis de
> ambiente. De qualquer forma, se fosse para eu fazer um one-liner, seria
> assim:
>
>  |
>  | $ perl -e 'map { print "$_=$ENV{$_}\n"; } keys %ENV;'
>  | HOME=/Users/otaviof
>  | MANPATH=/usr/share/man:/opt/local/share/man
>  | PERL_MM_OPT=INSTALL_BASE=/Users/otaviof/perl5
>  | COMMAND_MODE=unix2003
>  | DISPLAY=/tmp/launch-jaEXdx/org.x:0
>  | (...)
>  |
>
> um abraço,


Otávio é Golf e não one-liner :)

E esse é outro assunto, que era só para imprimir o %main::

Também o seu one-liner não tem a mesma saída do meu e do Thiago Sanshez.

[]'s

>
> --
> Otávio Fernandes
> otaviof at ( gmail.com, cpan.org )
> http://github.com/otaviof
> _______________________________________________
> SaoPaulo-pm mailing list
> SaoPaulo-pm em pm.org
> http://mail.pm.org/mailman/listinfo/saopaulo-pm
>



-- 
http://www.danielmantovani.com
"If you’ve never written anything thoughtful, then you’ve never had
any difficult, important, or interesting thoughts. That’s the secret:
people who don’t write, are people who don’t think."


More information about the SaoPaulo-pm mailing list