in reply to Scope of a Hash
I call a subroutine &createExcelChart that passes the hash in as *returnVals.
AAaaah !!! Why do you do this ??
Don't use typeglobs to pass variables around !
It's illegal ! It's punished by The Law (tm) ! It will not work with use strict !
If you want to pass a hash to a function you should use a reference to the hash, i.e :
In the function you can for example dereference the hash :my %hash = ( 'some' => 'things' ) ; callFunction( \%hash ) ;
sub callFunction { my $refhash = shift ; my %hash = %$refhash ; ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Scope of a Hash
by revdiablo (Prior) on Dec 15, 2005 at 20:02 UTC |