Welcome to the Monastery | |
PerlMonks |
Re: I am confused by a "Learning Perl" sample showing "unshift"by haukex (Archbishop) |
on Jan 22, 2021 at 22:23 UTC ( [id://11127312]=note: print w/replies, xml ) | Need Help?? |
I expected "unshift @lArray, @lNums" to expand to "unshift @lArray, 1 2 3" and then be processed as though The first part is correct (the contents of the @lNums array becomes part of the argument list to unshift), and as for the second part, note it's very simple to express what you thought would happen using Statement Modifiers: unshift @lArray, $_ for @lNums;
In Section
Seekers of Perl Wisdom
|
|