nega has asked for the wisdom of the Perl Monks concerning the following question:
I also have a subroutine that I would call like this:my (%hash1, %hash2, %hash3); my %hash_names = ( "%hash1" => "Hash One", "%hash2" => "Hash Two", "%hash3" => "Hash Three" );
I would like to call it like:&subroutine(\%hash1, "Hash One");
but I cant seem to work it out. Any pointers?foreach $key (sort keys %hash_names) { &subroutine($key, $hash_names{$key}); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using a hash key as another hash's name...
by merlyn (Sage) on Sep 03, 2000 at 04:28 UTC | |
by nega (Scribe) on Sep 04, 2000 at 09:06 UTC |