Data::Stack - A Stack!
use Data::Stack; my $stack = new Data::Stack();
Quite simple, really. Just a stack implemented via an array.
Creates a new Data::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!
Cory Watson, <cpan@onemogin.com>
Copyright (C) 2006 by Cory Watson
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.
To install Data::Stack, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Stack
CPAN shell
perl -MCPAN -e shell install Data::Stack
For more information on module installation, please visit the detailed CPAN module installation guide.