How do I specify string references in perl mode and not make Emacs dizzy?

I need to use references to (constant) strings in Perl. If I write:

my $a = \'test';
print $$a;

      

Emacs (23.3.1) perl-mode assumes a line starts with a second apostrophe and fills in padding and markup. Using double quotes ( "

) doesn't change this.

How can I get around this without using additional variables or switching to cperl mode, which I find quite "loud"?

+3


source to share


1 answer


Add a space after the backslash. Perl doesn't care and perl mode catches.



+5


source







All Articles