I am trying to improve Nano's syntax highlighting for Perl, but I have run into an interesting dilemma. Perl uses single quotes for literal strings, and double quotes for interpolated strings. The problem with this is that if I have a single quote in an interpolated string or vice versa, the next time I use that quote character, Nano will highlight from the middle of the prior string to the next use of the quote character, like so:

           v--  highlighted another color  --v
print "What's up Johnnie boy!\n"; print "What's up with you?\n";

Is there a way to set up the perl.nanorc file so that I don't match a pair of single quotes whose first quote character is in between a double quote pair?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.