Re: second-level string interpolation

2004-03-13 Thread Michael C. Davis
At 10:39 AM 3/13/04 -0800, R. Joseph Newton wrote: >> my $header = <<'end_of_header'; >> # File: $filename >> end_of_header >> >> my $filename = 'xyz'; >> print $header, "\n"; # output: want to see # File: xyz, but get # File: >> $filename > >I am not sure how the above is any m

Re: second-level string interpolation

2004-03-13 Thread R. Joseph Newton
"Michael C. Davis" wrote: > Hi, Apologies if I'm bringing up a repeated topic. I searched the list > archive and the web and nothing specific has turned up so far. > > Is there a way to defer evaluation of the contents of a here-doc-defined > value such that one can embed variables in the here-d

Re: second-level string interpolation

2004-03-12 Thread Michael C. Davis
Thanks everyone for the great ideas. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: second-level string interpolation

2004-03-12 Thread david
Randy W. Sims wrote: > I just realized that this might be a little misleading. If you break it > down to: > > my $result = eval $header; > print $result; > > You will get an uninitialized value error. What happens is that > > eval $header > > is first interpolated to > > eval { # File: xyz }

Re: second-level string interpolation

2004-03-12 Thread Randy W. Sims
On 03/12/04 16:08, Randy W. Sims wrote: To elaborate a bit, the reason for the failure is that while the string is interpolated, it is then also evaluated as perl code, so in my $header = <<'end_of_header'; # File: $filename end_of_header my $filename = 'xyz'; print eval $header; the last stat

Re: second-level string interpolation

2004-03-12 Thread John W. Krahn
"Michael C. Davis" wrote: > > Hi, Apologies if I'm bringing up a repeated topic. I searched the list > archive and the web and nothing specific has turned up so far. > > Is there a way to defer evaluation of the contents of a here-doc-defined > value such that one can embed variables in the her

Re: second-level string interpolation

2004-03-12 Thread Randy W. Sims
On 03/12/04 16:35, david wrote: Michael C. Davis wrote: Is there a way to defer evaluation of the contents of a here-doc-defined value such that one can embed variables in the here-doc and not have them evaluated until they are used later? Something like this: code: - use strict;

RE: second-level string interpolation

2004-03-12 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Michael C. Davis wrote: > Hi, Apologies if I'm bringing up a repeated topic. I searched the > list archive and the web and nothing specific has turned up so far. > > Is there a way to defer evaluation of the contents of a > here-doc-defined value such that one can embed variables in the > here-d

Re: second-level string interpolation

2004-03-12 Thread david
Michael C. Davis wrote: > > Is there a way to defer evaluation of the contents of a here-doc-defined > value such that one can embed variables in the here-doc and not have them > evaluated until they are used later? Something like this: > > code: > - > use strict; > use warn

second-level string interpolation

2004-03-12 Thread Michael C. Davis
Hi, Apologies if I'm bringing up a repeated topic. I searched the list archive and the web and nothing specific has turned up so far. Is there a way to defer evaluation of the contents of a here-doc-defined value such that one can embed variables in the here-doc and not have them evaluated until