in reply to splice an array
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: splice an array
by dbs (Sexton) on May 04, 2011 at 12:52 UTC | |
by toolic (Bishop) on May 04, 2011 at 13:01 UTC | |
by Anonymous Monk on May 04, 2011 at 13:24 UTC | |
by dbs (Sexton) on May 04, 2011 at 17:31 UTC | |
by dbs (Sexton) on May 04, 2011 at 17:48 UTC | |
by Anonymous Monk on May 04, 2011 at 12:57 UTC |