in reply to Printing Stacks

Your @stack is just an array, and you want to see them in the reverse order:

print $stack[ $_ ] for reverse 0 .. $#stack;

And if you really want to destroy the stack in the process, add:

undef @stack;

You could also do:

print while pop @stack;

But that's just wasteful :) (It's actually not, perl's arrays are well optimised for this operation.)


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
In the absence of evidence, opinion is indistinguishable from prejudice. Suck that fhit