Think about Loose Coupling | |
PerlMonks |
Re^3: unshift single scalarby Not_a_Number (Prior) |
on Aug 09, 2014 at 19:14 UTC ( [id://1096861]=note: print w/replies, xml ) | Need Help?? |
No. When the docs say 'unshift can take a scalar EXPR', they mean as the first argument, eg:
But that's probably too much information. What you need to understand is that the standard (non-experimental) syntax for unshift is: unshift ARRAY,LISTIt so happens (as is often the case) that the LIST that you want to add at the beginning of your ARRAY consists of just one element (namely 'Top'). Maybe the doc for unshift could benefit from a less obscure example of usage?
In Section
Seekers of Perl Wisdom
|
|