what about creating a new array instead of slicing?
for (@old) { push @new,@pre if /START_RE/; push @new,$_; push @new,@post if /END_RE/; }
(untested)
HTH
UPDATE:
Generally it's better to use an iterator that returns separated records.
Have a look at the "alternativ iterator" Re^2: reading several lines in a gulp (iterator) and change the last condition to split at /^=====================/
Cheers Rolf
In reply to Re: splice an array
by LanX
in thread splice an array
by dbs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |