Re: Really literal string

2008-03-25 Thread Gunnar Hjalmarsson
Chas. Owens wrote: #!/usr/bin/perl use strict; use warnings; my $s = 'foo $bar baz'; print "$s\n"; $s = <<'END_OF_STRING'; $s used to hold just: foo $bar baz END_OF_STRING print $s; It should be noted that those methods are not quite equivalent. C:\home>type test.pl my $s = 'My programs

Re: Really literal string

2008-03-25 Thread Gunnar Hjalmarsson
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 = < Use single quotes. my $s = <<'TEXT'; http://perldoc.perl.org/perlop.html#Single-Quotes -- Gunnar Hjalmarsson Email

Re: Really literal string

2008-03-25 Thread Jenda Krynicky
From: Keenlearner <[EMAIL PROTECTED]> > 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 = < This is a test $t > TEXT > > The above code still interpolate the string. I know that I can

Re: Really literal string

2008-03-25 Thread Chas. Owens
On Tue, Mar 25, 2008 at 12:01 PM, Keenlearner <[EMAIL PROTECTED]> 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 = < This is a test $t > TEXT > > The above code still inte

Re: Really literal string

2008-03-25 Thread Rob Dixon
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 = < If you put your terminating identifier in single-quotes, it behaves as if the entire here-document is in single-quotes: