in reply to Re^2: What is Perl way to simultaneously assign to three separate arrays?
in thread What is Perl way to simultaneously assign to three separate arrays?
No, you are using /g in list context which swallows the whole file now and returns a flat list.
You need an external loop to process the 3 groups
With a post while you can have the loop in the same line
push @res, [ $1,$2,$3 ] while m/.../g
In the OP you were originally looping with $_ , that's confusing.
you should rather be concerned about maintainability than shortness.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: What is Perl way to simultaneously assign to three separate arrays?
by CoVAX (Beadle) on Feb 15, 2015 at 20:40 UTC |