On that note, though, the following seems to be valid Perl code, if a little awkwardly:It works as far as I can tell, but my syntax hilighter goes nuts on it, closing the string at the first instance of '}', which makes sense. Perl seems to be extra careful about interpolating.my $sql = qq{ SELECT id FROM ${table} };
Perl takes balanced parens/brackets/braces/angles into account, that's why it works. Quoting from perlop:
Non-bracketing delimiters use the same character fore and aft, but the
four sorts of brackets (round, angle, square, curly) will all nest,
which means that
q{foo{bar}baz}
is the same as
'foo{bar}baz'
and it still goes on a bit. This is the perlop for 5.6.1. Older versions of this document aren't as elaborate, though they still mention that these pairs indeed do nest, at least up to the oldest version I found, v.5.004_05.
In reply to Re: Re: RegExp Delimiter
by bart
in thread RegExp Delimiter
by perchance
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |