rchiav has asked for the wisdom of the Perl Monks concerning the following question:
vs.while (my @fields = (getpwent)[6,7]) { map {print "$_\n"} @fields; print ("-" x 80); }
Just curious..while (my @fields = (getpwent)[6,7]) { foreach my $item (@list) { print "$_\n"; } print ("-" x 80); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 1: map vs. foreach
by tilly (Archbishop) on Apr 25, 2001 at 07:39 UTC | |
|
Re: map vs. foreach
by nardo (Friar) on Apr 25, 2001 at 07:07 UTC | |
|
Re: map vs. foreach
by hdp (Beadle) on Apr 25, 2001 at 07:39 UTC | |
|
Re: map vs. foreach
by Albannach (Monsignor) on Apr 25, 2001 at 07:27 UTC | |
|
Re: map vs. foreach
by jeroenes (Priest) on Apr 25, 2001 at 15:37 UTC |