LeGo has asked for the wisdom of the Perl Monks concerning the following question:
I am tryingpush @mass_info, {"PID" => $PID, "IO" => \@IO};
This does not work but this does.foreach(@mass_info){ print "$_{PID} \n"; }
I would like to know how perl does this foreach loop the first way.$counter = 0; foreach (@mass_info){ print "$mass_info[$counter++]{PID}\n"; }
Thanks in advance.
LeGo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Foreach on an array (of hashes)
by quidity (Pilgrim) on Nov 21, 2000 at 08:10 UTC | |
|
Re: Foreach on an array (of hashes)
by rlk (Pilgrim) on Nov 21, 2000 at 07:02 UTC | |
|
Re: Foreach on an array (of hashes)
by Fastolfe (Vicar) on Nov 21, 2000 at 19:23 UTC |