talking_walnut has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to assign the "value" to a scalar and return it but so far I'm not having any luck. $variable_name is being generated by a foreach loop and is definitely working. I've been trying code along the lines of%hash -> $variable_name -> 'fixed name(s)' -> value
But this gives me "0". Which it's not. print Dumper %hash shows a nice hash table containing all the data it should so I know it's there. Can someone tell me what I'm doing wrong here?my $value = values %{$hash{$variable_name}{'fixed name'}}; print $value;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to get specific hash elements?
by kyle (Abbot) on May 14, 2007 at 15:35 UTC | |
|
Re: How to get specific hash elements?
by MonkE (Hermit) on May 14, 2007 at 15:39 UTC | |
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 | |
|
Re: How to get specific hash elements?
by jdporter (Paladin) on May 14, 2007 at 15:33 UTC | |
|
Re: How to get specific hash elements?
by derby (Abbot) on May 14, 2007 at 15:33 UTC |