in reply to I am confused by a "Learning Perl" sample showing "unshift"
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;
|
|---|