in reply to RE: Hash Push
in thread Hash Push
For example:
The push is accessing the global data directly. Put whatever you want in there. Does that help?my %global_data; fill_recursively(\%global_data, 10); sub fill_recursively { my $data_href = shift; # hashref to modify my $count = shift; # what level are we push @{$data_href->{"key $_"}}, "level $count" for 1..$count; fill_recursively($data_href, $count - 1) if $count > 1; } use Data::Dumper; print Dumper(\%global_data);
-- Randal L. Schwartz, Perl hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: RE: Hash Push
by Adam (Vicar) on Aug 16, 2000 at 22:21 UTC | |
by merlyn (Sage) on Aug 16, 2000 at 22:29 UTC |