Re: Postponing variable replacement

2008-01-23 Thread Chas. Owens
On Jan 23, 2008 2:17 PM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: > Bryan R Harris wrote: > > Is there any way to change the last statement to do what I want, which in > > this case is print "perl is cool"? > > > > ** > > $a='$b is cool'; > > > > ... bunch o

Re: Postponing variable replacement

2008-01-23 Thread obdulio santana
using http://www.unix.org.ua/orelly/perl/advprog/ch05_01.htm maybe it helps #!/usr/bin/perl $t=' "$tt is cool\n"'; $tt="perl"; print eval $t; thanks regards # 2008/1/23, Bryan R Harris <[EMAIL PROTECTED]>: > > > > >> Is there any way to change the last statement to do what I want, which > in >

Re: Postponing variable replacement

2008-01-23 Thread Gunnar Hjalmarsson
Bryan R Harris wrote: Is there any way to change the last statement to do what I want, which in this case is print "perl is cool"? ** $a='$b is cool'; ... bunch of stuff here... $b = "perl"; print $a, "\n";' print eval qq("$a"), "\n"; -- Gunnar Hjalm

Re: Postponing variable replacement

2008-01-23 Thread Bryan R Harris
>> Is there any way to change the last statement to do what I want, which in >> this case is print "perl is cool"? [stuff cut out] > (my $new_message = $message) =~ s/\$(\w+)/$includes{$1}/g; [stuff cut out] Um, I guess... I was more curious if there wasn't something like: print "\S$b

Re: Postponing variable replacement

2008-01-23 Thread Tom Phoenix
On Jan 23, 2008 10:04 AM, Bryan R Harris <[EMAIL PROTECTED]> wrote: > Is there any way to change the last statement to do what I want, which in > this case is print "perl is cool"? Is this the kind of thing you're looking for? #!/usr/bin/perl use strict; use warnings; my $messa

Postponing variable replacement

2008-01-23 Thread Bryan R Harris
Is there any way to change the last statement to do what I want, which in this case is print "perl is cool"? ** $a='$b is cool'; ... bunch of stuff here... $b = "perl"; print $a, "\n";' ** Thanks! - Bryan -- To uns