in reply to Re^2: List::MoreUtils before, after and ... between? (1 regex)
in thread List::MoreUtils before, after and ... between?
FWIW, I'm quite often in a situation where I would prefere to apply regexes on lists, so I started meditating yesterday about a module abstracting the delimiter problem away by locally redefining a special var like $; or $\ for the delimiter and $_ for flattened list.
something like
@newlist = flat { s/START$;(.*)$;END/$1/ } @list sub flat (&@) { my ($code,@list) = @_; local ( $;, $_ ) = join_reliably (@list); $code->(); return split $;, $_ }
untested.
Cheers Rolf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: List::MoreUtils before, after and ... between? (1 regex)
by tye (Sage) on Feb 22, 2012 at 16:04 UTC | |
by LanX (Saint) on Feb 22, 2012 at 16:11 UTC | |
|
Re^4: List::MoreUtils before, after and ... between? (1 regex)
by LanX (Saint) on Feb 22, 2012 at 15:58 UTC |