How are you defining $variable? I just ran your code with $variable set to "Another generic key" and received 4575 out. See code below:
my %hash = ( "Common SW Component" => "4885", "Test MMA" => "5130", "Generic key" => "5033", "Another generic key" => "4575", ); my $variable = "Another generic key"; print "$hash{$variable}\n";
In reply to Re: Problems with Hash Keys and Spaces
by tptass
in thread Problems with Hash Keys and Spaces
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |