RE: Spam:Re: using $! for die()ing with Package function

2004-12-02 Thread Michael Kraus
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

RE: Spam:Re: using $! for die()ing with Package function

2004-12-02 Thread Ron Goral
> -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.

Re: Spam:Re: using $! for die()ing with Package function

2004-12-02 Thread JupiterHost.Net
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

Re: Spam:Re: using $! for die()ing with Package function

2004-12-02 Thread JupiterHost.Net
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

RE: Spam:Re: using $! for die()ing with Package function

2004-12-02 Thread Ron Goral
> -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

Re: Spam:Re: using $! for die()ing with Package function

2004-12-03 Thread Lawrence Statton
> 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: $!