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 $@
> >
> >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
> 
> Exactly right.  Except $@ is empty in this construction--no error is
> reported but the eval fails.
> 
> It has something to do with the way perl uses the setjmp and longjmp c
> functions.  I was reading something about that.
> 
> I'm trying to trap the syntax error.

It works for me.  I get the same result as Tomas.  $@ contains the expected
error message.

But what does this have to do with modperl??

Ronald

Reply via email to