Keenlearner wrote:
I like to store multiline perl code inside a scalar variable, but I
don't want perl to interpolate the variable inside the code.

my $t = "abc";

my $s = <<TEXT;
This is a test $t
TEXT

The above code still interpolate the string. I know that I can escape
the variable with backslash, but the code inside is much more
complicated than that as the would be subroutine as well. Any method
that I can use ?

Use single quotes.

    my $s = <<'TEXT';

http://perldoc.perl.org/perlop.html#Single-Quotes

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to