Perl syntax: recognize double-quotes in quote-like blocks
Posted: Sat Sep 20, 2003 12:43 am
Okay, that subject line is not easy to understand. Here's the problem:
See those double quotes in lines six and seven? The syntax highlighter thinks everything from the middle of line six to the middle of line seven is quoted, but it's not or course. It's much worse when you have a line with one quote and no other line like that for a long time. You either have to turn off multi-line quoting of do something like this:
Code: Select all
#!/usr/bin/perl -w
$_= qq/"text with actual quotes"/;
# Strip quotes
s/^"//;
s/"$//;
Code: Select all
s/^"//; #"
s/"$//; #"