
| Contents |
|||||||||||||||
| [an error occurred while processing this directive] |
3.4.2.1 Arrays as Stacks
What more is a stack than an unbounded array of things? This attitude
is seen in Perl through the
use strict; my @stack; push(@stack, 7, 6, "go"); # @stack is now qw/7 6 go/ my $action = pop @stack; # $action is "go", @stack is (7, 6) my $value = pop(@stack) + pop(@stack); # value is 6 + 7 = 13, @stack is empty |