Your syntax is invalid. Instead of = between the key and the value, you need the "fat comma" => as shown below. Does this do what you want?
use strict; use warnings; my %hash = ( "rabbit" => "pap", "triangle" => "tri" ); my $key = "rabbit"; print $hash{$key}; # prints "pap"
In reply to Re: Pattern matching with hash keys
by eyepopslikeamosquito
in thread Pattern matching with hash keys
by tej
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |