Re: Re[2]: redirecting print output to a variable

2001-08-24 Thread Bas Bloemsaat
> BB> This doesn't work, unfortunately. There's more than one print statement in > BB> the original $generated code. Code like this is very possible: > BB> $generatedCode = '$test = "some result"; $val1 = 10; print "test is: > BB> $test,"; $val2=20; print ($val1 * $val2);'; > $generatedCode =~ s/

Re: redirecting print output to a variable

2001-08-23 Thread Maxim Berlin
Hello Bas, Thursday, August 23, 2001, Bas Bloemsaat <[EMAIL PROTECTED]> wrote: BB> I've got this code: BB> #Example of generated code. I have little influence over the actual code in BB> the variable. It's generated from a template. BB> $generatedCode = '$test = "some result"; print "test is: $

redirecting print output to a variable

2001-08-23 Thread Bas Bloemsaat
Hi, I've got this code: #Example of generated code. I have little influence over the actual code in the variable. It's generated from a template. $generatedCode = '$test = "some result"; print "test is: $test";'; open MYFILE, ">somefile"; select(MYFILE); my $testvar = eval "$generatedCode"; sel