Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Why are "push", "pop", "shift" and "unshift" so named?

by ambrus (Abbot)
on May 02, 2007 at 14:06 UTC ( [id://613164]=note: print w/replies, xml ) Need Help??


in reply to Why are "push", "pop", "shift" and "unshift" so named?

Shift is from the builtin command of same name in unix shells. It shifted a command-line argument from the beginning, so that if you used it in a loop, you could loop through command-line arguments in normal order. Even the DOS command.com has copied that command with the same name.

Update: I see jbert has already said this in his reply.

  • Comment on Re: Why are "push", "pop", "shift" and "unshift" so named?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2024-04-24 10:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found