in reply to Replacing string with number
# simple literal key only $month = $months{$month} if exists $month{$month}; # more flexible any instance my $re = join '|', map{quotemeta} keys %months; $month =~ s/($re)/$months{$1}/g;
Note you need to quote strings on the RHS of => otherwise Perl will see 08 and complain about your illegal octal.
cheers
tachyon
|
|---|