Problems? Is your data what you think it is? | |
PerlMonks |
perlfunc:eachby gods (Initiate) |
on Aug 24, 1999 at 22:41 UTC ( [id://183]=perlfunc: print w/replies, xml ) | Need Help?? |
eachSee the current Perl documentation for each. Here is our local, out-dated (pre-5.6) version: each - retrieve the next key/value pair from a hash
each HASH
When called in list context, returns a 2-element list consisting of the key
and value for the next element of a hash, so that you can iterate over it.
When called in scalar context, returns the key for only the ``next''
element in the hash. (Note: Keys may be
Entries are returned in an apparently random order. When the hash is entirely read, a null array is returned in list context (which when assigned produces a
FALSE (
The following prints out your environment like the
while (($key,$value) = each %ENV) { print "$key=$value\n"; } |
|