in reply to using map and anonymous subroutines
The split " " construct ensures that the function splits on whitespace, /\s+\, after skipping any leading whitespace although when I tried split with and without the " " argument, it worked correctly both ways.use strict; use warnings; my @tmp01 = (); push @tmp01, map{ $_."\n"} split " " while <DATA>; exit; __DATA__ foo bar munch bar foo bar
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: using map and anonymous subroutines
by linux454 (Pilgrim) on Apr 20, 2004 at 14:21 UTC |