You can, but it involves symbolic references that you really shouldn't bother with until you know why.
Instead, you need a symbol table of your own. Either:
ormy %destinations; if ($line =~ /.*Cannot find valid (destination) for type:(.*)=(.*)/) { $destinations{$type}{$key} = ""; }
The first option is better. (Advanced monks may disagree, but for beginners, it simply is better. You can learn the second way when you really understand the first way and its limitations.)my %citystate; my %citycountry; my %country; my %airportCode; my %geonameid; my %symboltable = ( citystate => \%citystate, citycountry => \%citycountry, country => \%country, airportCode => \%airportCode, geonameid => \%geonameid ); if ($line =~ /.*Cannot find valid (destination) for type:(.*)=(.*)/) { $symboltable{$type}{$key} = "" }
In reply to Re: dynamic hash name
by Tanktalus
in thread dynamic hash name
by priyankgandhi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |