http://www.perlmonks.org?node_id=613162


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

push and pop come from stack terminology, while shift comes from queues (to be combined with push).

unshift is, like somebody else said, just the opposite of shift, like unget is the opposite of get. Not exactly proper English, but clear enough for the insiders — us.

But technically, there's no reason why the array ends could not have been swapped. You get a just as fine stack if you just use unshift/shift as primitives instead of the usual push/pop, and, for queues, unshift/pop, instead of push/shift.