Applying pattern match (m//) to %hash will act on scalar(%hash) at foo.pl line 10.