in reply to tr/// on a list
it seems not terribly perlish.
Well actually, a foreach is actually quite perlish. To be terribly perlish, one would shorten it down to a for modifier that operates on $_ implicitly aliasing over each element
for (@beatles) { tr /A-Z/a-z/ }
written more concisely as
tr /A-Z/a-z/ for @beatles;
which is probably more elegant than a vulgar map.
@beatles = map {lc} @beatles;
update: gah! I do ramble on.
• another intruder with the mooring in the heart of the Perl
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: tr/// on a list
by GrandFather (Saint) on Sep 14, 2007 at 22:37 UTC |