use Data::Dumper; $hash = {1 => "(\\d+)"}; #the value is (\d+) print "result from print Dumper:\n"; print Dumper($hash); #which prints (\\d+), this really confused me print "\n"; print "actual value stored:\n"; print $hash->{1};