in reply to Weird hash access problem

print $1; #print "a1"

No, it prints "a1 ". Your parens are misplaces in your regex pattern.

... Too slow. But wow, 4 replies in a span that could be as little as 61 seconds!