Nested Interpolation

2006-03-31 Thread Steve Thames
Consider this: my %names = (Bob = 'Robert Brower'); my $caption = 'Name: $names{Bob)'; print eval qq|$caption|; If you can't see it, there is a syntax error in $caption: closing paren ) instead of brace }. The eval will produce no $@ and will return the empty string.

Re: Nested Interpolation

2006-03-31 Thread Michael Peters
Steve Thames wrote: Consider this: my %names = (Bob = 'Robert Brower'); my $caption = 'Name: $names{Bob)'; print eval qq|$caption|; If you can't see it, there is a syntax error in $caption: closing paren ) instead of brace }. The eval will produce no $@ and will

Re: Nested Interpolation

2006-03-31 Thread Tomas Zerolo
On Fri, Mar 31, 2006 at 05:41:32AM -0800, Steve Thames wrote: Consider this: my %names = (Bob = 'Robert Brower'); my $caption = 'Name: $names{Bob)'; print eval qq|$caption|; [...] Does anyone have any idea how to capture the syntax error in a case like this? You mean

Re: Nested Interpolation

2006-03-31 Thread Steve Thames
On Fri, 31 Mar 2006 16:33:56 +0200, [EMAIL PROTECTED] (Tomas Zerolo) wrote: On Fri, Mar 31, 2006 at 05:41:32AM -0800, Steve Thames wrote: Consider this: my %names = (Bob = 'Robert Brower'); my $caption = 'Name: $names{Bob)'; print eval qq|$caption|; [...] Does anyone have

Re: Nested Interpolation

2006-03-31 Thread Hans Meier (John Doe)
Steve Thames am Freitag, 31. März 2006 15.41: Consider this: my %names = (Bob = 'Robert Brower'); my $caption = 'Name: $names{Bob)'; print eval qq|$caption|; If you can't see it, there is a syntax error in $caption: closing paren ) instead of brace }. The eval will

Re: Nested Interpolation

2006-03-31 Thread Ronald J Kimball
On Fri, Mar 31, 2006 at 07:05:41AM -0800, Steve Thames wrote: On Fri, 31 Mar 2006 16:33:56 +0200, [EMAIL PROTECTED] (Tomas Zerolo) wrote: You mean something like... my %names = (Bob = 'Robert Brower'); my $caption = 'Name: $names{Bob)'; print eval qq|$caption|; die $@ if $@

Re: Nested Interpolation

2006-03-31 Thread Hans Meier (John Doe)
Hans Meier (John Doe) am Freitag, 31. März 2006 18.37: Steve Thames am Freitag, 31. März 2006 15.41: Consider this: my %names = (Bob = 'Robert Brower'); my $caption = 'Name: $names{Bob)'; print eval qq|$caption|; If you can't see it, there is a syntax error in $caption:

Re: Nested Interpolation

2006-03-31 Thread Steve Thames
Ok, thanks for you help guys. I've got the answer now and its working. Sorry for the post here. I was posting a couple of other questions here and didn't think about this not being related to mod_perl. Mod_perl is where I'm using it though. Thanks again. On Fri, 31 Mar 2006 05:41:32 -0800,