in reply to How many levels of indirection in a Hash?
use warnings; use strict; my %hash; $hash{three}{levels}{deep} = 7500; $hash{process}{three}{levels}{deep} = 9000; $hash{process}{numberoflevels} = 4; for my $process(qw/ process no_process /){ my $hashbase; if (exists $hash{$process}){ $hashbase = $hash{$process}; } else { $hashbase = \%hash; } print "$process - ",$hashbase->{three}{levels}{deep},"\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How many levels of indirection in a Hash?
by Roy Johnson (Monsignor) on Jun 07, 2005 at 23:39 UTC |