While cruising through the Perl source, I found this delightful line of code in
toke.c, in the
S_scan_str() function:
if (term && (tmps = strchr("([{< )]}> )]}>", term)))
term = tmps[5];
It blew my mind. What it does is find the matching delimiter for a
q// string if the delimiter happens to be one of those specific characters.
Here's the quiz. First, how does it work? Second, why is )]}> repeated?
_____________________________________________________
Jeff[japhy]Pinyan:
Perl,
regex,
and perl
hacker, who'd like a job (NYC-area)
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;