boobooboy has asked for the wisdom of the Perl Monks concerning the following question:
this is in package$hash = test::this(\%hash); for my $box (keys %{$hash}){ print "this is box $box\n"; for my $par (keys %{$hash{$box}}){ print "this is partition $par\n"; for my $sec (keys %{$hash->{$box}->{$par}}){ print "this is section $sec\n"; } } }
-----------------------sub this { $temp = @_; $Dbox = "Dbox"; $DDD = "DDD"; $temp{"Dbox"}= "Dbox"; $temp{Dbox}{$DDD}= "DDD"; for my $box (keys %temp){ print "this is box $box\n"; for my $par (keys %{$temp{$box}}){ print "this is partition $par\n"; for my $sec (keys %{$temp{$box}->{$par}}){ print "this is section $sec\n"; } } } return \%temp; }
Edited by Chady -- added code tags.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Passing hash to package sub and get it returned ..
by kvale (Monsignor) on Apr 02, 2004 at 04:37 UTC | |
by Hofmator (Curate) on Apr 02, 2004 at 09:31 UTC | |
|
Re: Passing hash to package sub and get it returned ..
by Taulmarill (Deacon) on Apr 02, 2004 at 08:21 UTC |