in reply to How to get specific hash elements?
If I understand you correctly, you should be able to use $hash{$variable_name}{'fixed name'} both as an lvalue or an rvalue.
Try this (tested):
use strict; my %hash; $hash{'test1'}{'fixed name'} = 42; my $variable_name = 'test1'; print $hash{$variable_name}{'fixed name'}; print "\n";
When executed, it prints 42.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to get specific hash elements?
by talking_walnut (Initiate) on May 14, 2007 at 15:56 UTC | |
by derby (Abbot) on May 14, 2007 at 17:59 UTC | |
by talking_walnut (Initiate) on May 15, 2007 at 08:59 UTC | |
by jdporter (Paladin) on May 14, 2007 at 16:07 UTC | |
by talking_walnut (Initiate) on May 14, 2007 at 16:16 UTC | |
by Roy Johnson (Monsignor) on May 14, 2007 at 18:05 UTC |