Actually iirc you are better off using push/pop and $array[-1] instead of shift/unshift and $array[0] From what i remember (i should recheck the source) perls arrays are written with a slight bias towards adding things to the end over sticking them on the front.
Also why stop at a stack? You can implement a queue with unshift/push, and a deque with unshift/shift and push/pop.
In reply to Re: Categorized Questions and Answers: tips and tricks
by demerphq
in thread Categorized Questions and Answers: tips and tricks
by GrandFather
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |