in reply to Re: Making a hash of regexes
in thread Making a hash of regexes
A little experiment:qr/STRING/imosx This operator quotes (and possibly compiles) its STRING as a regular expression. STRING is inter polated the same way as PATTERN in "m/PATTERN/". If "'" is used as the delimiter, no interpolation is done. Returns a Perl value which may be used instead of the corresponding "/STRING/imosx" expression.
prints out (?-xism:(.+)pippo), which can be used in the matching part of a regex, whileuse strict my %a = (qr/(.+)pippo/, 1); print keys %a;
dies with erroruse strict; my %a = (1,2); my %b = (\%a, 3); for (keys %b) { print %$_ };
|
|---|