Just another Perl shrine | |
PerlMonks |
Re^3: multiple matches per line *AND* multiple capture groups per matchby kcott (Archbishop) |
on Dec 22, 2013 at 05:48 UTC ( [id://1068087]=note: print w/replies, xml ) | Need Help?? |
"So in general, is it not possible to do a multi-array assignment in a single line, i.e.: (@a, @b) = <some_expression>" That's correct with the syntax you're using there; however, you can do it with references. Here's a rather contrived example to demonstrate.
Output:
If you're unfamiliar with references, a good place to start is "perlreftut - Mark's very short tutorial about references". In the "The Rest" section, you'll find links to more detailed documentation on this topic. -- Ken
In Section
Seekers of Perl Wisdom
|
|