Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: I am confused by a "Learning Perl" sample showing "unshift"

by rsFalse (Chaplain)
on Jan 23, 2021 at 22:13 UTC ( #11127344=note: print w/replies, xml ) Need Help??


in reply to I am confused by a "Learning Perl" sample showing "unshift"

This natural confusion may occur because there are two ways how to prepend one array to another. You can prepend starting from the beginning of an array or from the end.
Here, in Perl, unshift prepends an array starting from the end.
Documentation says it is opposite to 'push', but how opposite? By how many of attributes - by one or two? One attribute is the positions of the target array to which new array is being added (to the beginning or to the end). Second is an orientation of second array. In Perl - by two.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11127344]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2022-08-12 02:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?