in reply to PerlCritic, $_ and map
I never thought about these side effects and I'm glad I looked into this node. Each time I'm here I learn something new & valuable. Thanks to all of you!
But to say something in regards to the code example: Now that I know of the problems using this kind of trimming in map, what do you think about this alternative?
my @files = map { /^\s*(\S.*?)\s*$/ && $1 || "" } <$FILES>;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: PerlCritic, $_ and map
by ikegami (Patriarch) on Feb 12, 2009 at 23:00 UTC | |
|
Re^2: PerlCritic, $_ and map
by JavaFan (Canon) on Feb 13, 2009 at 08:31 UTC | |
by Skeeve (Parson) on Feb 13, 2009 at 16:06 UTC |