In the first snippet, I originally had 'map' instead of 'grep'. 'map' will give back the return value from the s/// operator, which is not the modified string.
(from another follow-up:)In that case, make a copy. And return $_.
But you missed one aspect in your version: filter { s/a/b/ } @list shouldn't modify the original @list.
map { local $_ = $_; s/^[^-]*-//; $_ } LIST
In reply to Re: (tye)Re: sorting an array with an array
by bart
in thread sorting an array with an array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |