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?
Thanks...
Regards,
Michael S. E. Kraus
Software Developer
Wild Technology Pty Lt
> -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.
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;
}
Thanks Ron, yeah if I want to I'll have to pro
I think the misunderstanding is:
$! is not a general purpose error message, it is a magical wrapper
around errno() (read the section in perlvar)
You *COULD* set $! to some numeric value selected from errno.h if
there was one close enough to your message. But a user of your
library getting "Di
> -Original Message-
> From: JupiterHost.Net [mailto:[EMAIL PROTECTED]
> Sent: Thursday, December 02, 2004 7:06 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Spam:Re: using $! for die()ing with Package function
>
>
> > I don't think you can't set $! si
> 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?
>
> Thanks...
>
> Regards,
>
I think the misunderstanding is:
$!