Reputation: 1400
I need to use references to (constant) strings in Perl. If I write:
my $a = \'test';
print $$a;
Emacs (23.3.1)'s perl-mode thinks that a string starts at the second apostrophe and messes up filling and fontification. Using double quotes ("
) doesn't change this.
How can I work around this without using extra variables or switching to cperl-mode which I find rather "loud"?
Upvotes: 2
Views: 52
Reputation: 241968
Add a space after the backslash. Perl does not care and perl-mode catches up.
Upvotes: 4