in reply to creating defined references to arrays of size zero
my %stacks; my $CurrentArrayRef = $Stacks{nonexistant} || []; # Line above CREATES a ref to an empty array if the stack was undefine +d. #It returns a ref to the contents if there were any. push @$CurrentArrayRef, "New Value"; ... more code ... # Now (re)store the contents into the stack $Stacks{nonexistant} = $CurrentArrayRef;
"Income tax returns are the most imaginative fiction being written today." -- Herman Wouk
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: creating defined references to arrays of size zero
by tlm (Prior) on Jul 14, 2005 at 05:41 UTC |