in reply to map, grep, for, foreach
How about even more simply and efficiently using methods provided by CGI.pm ...
- my %input = CGI::Vars;
The above performs the same as your proposed code but ties your array in with that used internally within CGI.pm for the storage of CGI parameters.
Of the proposed code samples provided however, map and grep would be poor choices as, in the examples given, these are being used in a void context, the return values built and returned by these functions discarded. With regard to for and foreach, according to perlsyn, foreach is merely a synonym for for, the choice between the two representing a balance for the programmer between readability and brevity.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: map, grep, for, foreach
by Kanji (Parson) on Jun 06, 2002 at 11:51 UTC | |
Just a quick note...
by Anonymous Monk on Jun 06, 2002 at 14:28 UTC | |
by Elian (Parson) on Jun 06, 2002 at 18:04 UTC | |
by jsprat (Curate) on Jun 06, 2002 at 18:25 UTC | |
by runrig (Abbot) on Jun 06, 2002 at 17:39 UTC |
In Section
Seekers of Perl Wisdom