in reply to RE: Re: parsing
in thread parsing
can be replaced with:@result = map SOME_EXPRESSION, @input;
In other words, evaluate SOME_EXPRESSION for each @input item, and take the result(s) of that, concatenated together, to make an output. While the expression is being evaluated, $_ contains the "current item" from @input.@TEMP = (); foreach $_ (@input) { push @TEMP, SOME_EXPRESSION; } @result = @TEMP;
-- Randal L. Schwartz, Perl hacker
|
---|