Re: passing hash data from one subroutine to another using refs

2005-07-29 Thread Tom Allison
sub func2 { my ($ref_hash) = @_; foreach my $key ( keys %$ref_hash ){ print "$key: $ref_hash->{$key}\n"; } } What you can't do here is: sub func2 { my %hash = @_; } You've broken the reference back to the original hash. you will

RE: passing hash data from one subroutine to another using refs

2005-07-28 Thread Ankur Gupta
Brent Clark wrote: > Hi Hi, > Would someone please clear up / help me understand this. Sure. > I have a hash > > my %allTariffData = {}; I think you meant my %allTariffData = (); > and in my sub > > I have > my %tariffData = {}; Same here.. my %tariffData = ()