[Israel.pm] P roblem with

Offer Kaye offer.kaye at gmail.com
Sun Oct 17 05:59:18 PDT 2004


On Sun, 17 Oct 2004 14:35:28 +0200, Yaron Golan wrote:
> > Do anyone have a clue about the aim of this section of code :
> > 
> > while(($key,$val) = each %ENV){
> >         print $key.":".$val."\n";
> > }
> >
> Print the key and value of each key in a hash?
> 

Yes, but not just any hash- the special ENV hash, which is the Perl
hash that holds your environment variables. See "perldoc perlvar" for
explanation of the %ENV hash, which also includes an example very
similiar to the above code. See "perldoc -f each" for explanation of
the "each" function.

-- 
Offer Kaye



More information about the Perl mailing list