in reply to Is silent use of $_ for empty argument lists reasonable for "shortcut" functions?
I think this avoids your problem.sub trim { my (@out) = @_; foreach (@out) { s/^\s+//; s/\s+$//; } return wantarray ? @out : $out[0]; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is silent use of $_ for empty argument lists reasonable for "shortcut" functions?
by Wyrdweaver (Beadle) on Aug 25, 2007 at 23:28 UTC | |
|
Re^2: Is silent use of $_ for empty argument lists reasonable for "shortcut" functions?
by bruceb3 (Pilgrim) on Aug 25, 2007 at 23:25 UTC | |
by enemyofthestate (Monk) on Aug 26, 2007 at 04:13 UTC |