> -----Original Message-----
> From: Michael Kraus [mailto:[EMAIL PROTECTED]
> Sent: Thursday, December 02, 2004 6:43 PM
> To: [EMAIL PROTECTED]; JupiterHost.Net;
> [EMAIL PROTECTED]
> Subject: RE: Spam:Re: using $! for die()ing with Package function
>
>
> G'day...
>
> > Return undef or 0, just like you are doing.  Both your calls
> > to baz have an argument, so 1 is returned both times.  I
> > prefer undef for false.
>
> Ahh... But how do you set $! in the enclosing scope?
>

I don't think you can't set $! since it is a system var.  Perhaps you could
do something like:

my $err_text;

die $err_text if !Foo();

sub Foo_baz
        {
        return 1 if shift;
        $err_text = "Your error message."
        return 0;
        }

Peace -
Ron



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to