in reply to Problems with Hash Keys and Spaces
Works fine for me. Are you sure $variable has in it what you think it has in it? Where are you getting the value? Have you tried to print it or dump it with Data::Dumper?
my %hash = ( "Common SW Component" => "4885", "Test MMA" => "5130", "Generic key" => "5033", "Another generic key" => "4575", ); my $variable = "Another generic key"; print "$hash{$variable} ($variable)\n"; __END__ 4575 (Another generic key)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problems with Hash Keys and Spaces
by Anonymous Monk on Aug 08, 2008 at 16:31 UTC | |
by kyle (Abbot) on Aug 08, 2008 at 16:32 UTC |