in reply to Compiled regex as hash key vs. string?

Actually, both keys are strings and neither key is a compiled regexp. A strinfigied copy of what is in the curlies is used as the key.
use strict; use warnings; my %test; my $re = qr/foo/; my $s = 'foo'; print('re: ', ref($re) || 'Not Regexp', "\n"); print('s: ', ref($s ) || 'Not Regexp', "\n"); $test{$re} = 1; $test{$s } = 1; foreach (keys %test) { print("key $_: ", ref($_) || 'Not Regexp', "\n"); }
outputs
re: Regexp s: Not Regexp key (?-xism:foo): Not Regexp key foo: Not Regexp