perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@tuxteam.de (Tomas Zerolo)
Subject Re: Nested Interpolation
Date Fri, 31 Mar 2006 14:33:56 GMT
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 something like...

  my %names = (Bob => 'Robert Brower');
  my $caption = 'Name: $names{Bob)';
  print  eval "qq|$caption|";
  die $@ if $@

giving:

  syntax error at (eval 1) line 1, near "Bob)"
  Missing right curly or square bracket at (eval 1) line 1, within string

HTH
-- tomas

Mime
View raw message