Welcome to the Monastery | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Replace the return with a function (push, unshift, splice, as examples) that builds up a temporary array that you return. I would probably build it in two parts -- one that iterates over all of @data, one line at a time, and the other part that handles one line at a time. I might even put the part that iterates over @data back into the code that is calling your sub (perhaps with map or something similar). Your code is basically selecting a group of lines, and then transforming them. To me that says something along these lines (see grep and map):
--MidLifeXis In reply to Re^3: Returning Array
by MidLifeXis
|
|