I don't know how to do it without references, I just wanted to add that in Perl 6 you can achieve just that in "slice" context.
So
my (@a, @b) = my_sub() will force slice context to my_sub, so if
sub my_sub { return @a, @b; } it will not be flattened automatically.
I've just been corrected that my (@a, @b) = my_function() would only fill @a, so the right way to do it would either be binding or my ($a, $b) = slice my_function(), but you can use $a like a real array (and not just an array ref) in Perl 6
You can explicitly enforce slice contect with slice or with @@.
One more reason to look forward to Perl 6 ;-)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.