in reply to matching single-quoted-like strings (q{}, q//)

I believe I got a version that runs a bit quicker this time:)

#! perl -slw use strict; my %lookup; @lookup{map chr, 32..127}=map chr, 32..127; @lookup{'{', '(', '[', '<'} = ('}', ')', ']', '>'); my $string = do{ local $/; <DATA>}; print "Match:'$2'" while $string =~ m[\bq(.)(.+?(??{ $lookup{$1} }))]s +og; __DATA__ my $km = q'BEGIN simple foo bar baz END'; my $kv = q#BEGIN foo bar \# baz END#; my $kk = q{BEGIN super foo bar banzai END}; my $kt = q{BEGIN super foo \{super\} bar banzai END};

Examine what is said, not who speaks.
1) When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
2) The only way of discovering the limits of the possible is to venture a little way past them into the impossible
3) Any sufficiently advanced technology is indistinguishable from magic.
Arthur C. Clarke.