But if you are trying to make a stack for actuall use in Perl, just use an array. Then you get push and pop free!, plus arrays are like double ended queues, so you get shift and unshift.
See Shift, Pop, Unshift and Push with Impunity! for some good insight into this.
In reply to Re: Simple stack implementation
by Adam
in thread Simple stack implementation
by quidity
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |