in reply to Problems with Hash Keys and Spaces
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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problems with Hash Keys and Spaces
by Anonymous Monk on Aug 08, 2008 at 16:33 UTC | |
by FunkyMonk (Bishop) on Aug 08, 2008 at 16:36 UTC | |
by Anonymous Monk on Aug 08, 2008 at 16:43 UTC | |
by FunkyMonk (Bishop) on Aug 08, 2008 at 16:46 UTC | |
by ZimCS (Novice) on Aug 08, 2008 at 17:13 UTC | |
| |
by tptass (Sexton) on Aug 08, 2008 at 17:04 UTC | |
by Your Mother (Archbishop) on Aug 08, 2008 at 22:48 UTC | |
by varian (Chaplain) on Aug 09, 2008 at 12:42 UTC | |
by Anonymous Monk on Aug 08, 2008 at 16:46 UTC | |
by repellent (Priest) on Aug 08, 2008 at 17:38 UTC |