in reply to creating defined references to arrays of size zero
Like Ovid said:
As long as you deal with references (like $current_stack) above, the changes you make will be reflected in the stacks stored in %stacks.my %stacks = ( A => [], B => [], . . . Z => [], ); # microseconds later... my $current_stack = $stacks{ K }; # for example push @$current_stack, 'whatever'; # etc.;
You can initialize the stacks more succinctly with something like this:
...where @names holds the names of the stacks.my %stacks; @stacks{ @names } = map [], @names;
the lowliest monk
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: creating defined references to arrays of size zero
by spieper (Initiate) on Jul 14, 2005 at 07:53 UTC | |
by spieper (Initiate) on Jul 14, 2005 at 15:49 UTC | |
by NetWallah (Canon) on Jul 14, 2005 at 17:32 UTC |