Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

by rsFalse (Chaplain)
on Jan 23, 2021 at 22:13 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 11:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found