Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I understand what the code is doing (ie: setting the keys for the hash %fields equal to the elements in the array @fields). What I don't understand is why it works. What is the autoincrement doing? Can anyone explain this?grep ($fields{$_}++, @fields);
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Use of grep with arrays/hashes
by merlyn (Sage) on May 24, 2001 at 01:59 UTC | |
by AidanLee (Chaplain) on May 24, 2001 at 02:57 UTC | |
by tenya (Beadle) on May 24, 2001 at 07:50 UTC | |
by merlyn (Sage) on May 24, 2001 at 09:12 UTC | |
|
Re: Use of grep with arrays/hashes
by geektron (Curate) on May 24, 2001 at 01:54 UTC | |
by petdance (Parson) on May 24, 2001 at 02:11 UTC | |
|
Re: Use of grep with arrays/hashes
by Anonymous Monk on May 25, 2001 at 13:02 UTC | |
|
Re: Use of grep with arrays/hashes
by DeaconBlues (Monk) on May 24, 2001 at 06:38 UTC | |
by ar0n (Priest) on May 24, 2001 at 06:49 UTC | |
by tilly (Archbishop) on May 24, 2001 at 08:05 UTC |