in reply to Re^2: Basic list manipulation, and a bit of map() confusion...
in thread Basic list manipulation, and a bit of map() confusion...
Not exactly:
perl -le "print for map s/x//g ? $_ : (), @ARGV" 1 2 3x 4xx xxx 6x 3 4 6
perl -le "print for map tr/x//d ? $_ : (), @ARGV" 1 2 3x 4xx xxx 6x 3 4 6
The return value of s/// and tr[] is the number of substitutions made, not the modified string (unfortunatley).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Basic list manipulation, and a bit of map() confusion...
by jwkrahn (Abbot) on Feb 24, 2008 at 22:47 UTC | |
by kyle (Abbot) on Feb 24, 2008 at 23:00 UTC |