Tim,

> >
> > When you call [EMAIL PROTECTED]>getMessage(), it in turn has eval{} 
> > statements
> > inside it somewhere, thereby resetting the $@ globlal variable.
>
> Is there some reason why the code within getMessage that calls eval {}
> can't do
>
>         local $@;
>
> to protect the caller from such surprises?

I'm not a pro when it comes to "local".

Doesn't that make sense only if the exception is treated locally
(inside the Inline::Java code) ? In most cases I will have code like
this inside Inline::Java:

eval {
  # do something
} ;
if ($@){
  if ($@ =~ /some exception type/){
     # treat the exception locally
  }
  else {
    # let the caller handle it
    die $@ ;
  }
}

Can "local $@" be used in such cases? Ideally, if I understand
correctly, the goal would be not to change (the "real") $@ unless
another "fatal" error has occured.

>
> Tim.
>


--
=====================
Patrick LeBoutillier
Laval, Québec, Canada

Reply via email to