in reply to Re^3: Capturing regex from map
in thread Capturing regex from map
Not clean ...
... in part, perhaps, because the @a input array is affected (via aliasing) and winds up 'oba-oba-obo-ed':
>perl -wMstrict -le "my @a = qw(foobar barfoo foobaz bar foobor); my @c = grep {s/fo(ob.).+/$1/} @a; ;; printf qq{'$_' } for @c; print qq{\n}; printf qq{'$_' } for @a; " 'oba' 'oba' 'obo' 'oba' 'barfoo' 'oba' 'bar' 'obo'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Capturing regex from map
by Laurent_R (Canon) on Sep 14, 2013 at 13:40 UTC |