XML::Pastor::Stack - A Stack!
This module is used internally by XML::Pastor. You do not normally know much about this module to actually use XML::Pastor. It is documented here for completeness and for XML::Pastor developers. Do not count on the interface of this module. It may change in any of the subsequent releases. You have been warned.
use XML::Pastor::Stack; my $stack = new XML::Pastor::Stack();
Quite simple, really. Just a stack implemented via an array.
This module is a blunt copy of the Data::Stack module. I had originally intended to use that module but it turns out that it -superflously- requires perl 5.8.6 to build and I only had perl 5.8.4 on my system with no means to upgrade. So that's why I had to copy all the code in Data::Stack into this otherwise needless module.
- new( [ @ITEMS ] )
Creates a new XML::Pastor::Stack. If passed an array, those items are added to the stack.
Returns the item at the top of the stack but does not remove it.
Returns the item at position $INDEX in the stack but does not remove it. 0 based.
Returns the number of items in the stack.
Returns a true value if the stack is empty. Returns a false value if not.
Completely clear the stack.
Removes the item at the top of the stack and returns it.
Adds the item to the top of the stack.
None by default.
There are various Stack packages out there but none of them seemed simple enough. Here we are!
Ayhan Ulusoy <dev(at)ulusoy(dot)name>
The author of the original module Data::Stack is: Cory Watson, <email@example.com>
COPYRIGHT AND LICENSE
Copyright (C) 2006-2007 by Ayhan Ulusoy. (A shame, as the code is copied from Data::Stack by Cory Watson)
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.