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, Ste

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 e

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|"; > >

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

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|"; >[...] >> Do

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? Y

Re: Nested Interpolation

2006-03-31 Thread Steve Thames
On Fri, 31 Mar 2006 08:48:20 -0500, Michael Peters <[EMAIL PROTECTED]> wrote: > > >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 er

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 $@ an

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.