> 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: $! 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 "Divide by zero error" because that was the closest thing you could find for "Didn't give me the wumble structure I wanted" is going to be sorely confused. Maybe you should be looking at croak and friends, or even taking the bigger step and start throwing exceptions. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Lawrence Statton - [EMAIL PROTECTED] s/aba/c/g Computer software consists of only two components: ones and zeros, in roughly equal proportions. All that is required is to sort them into the correct order. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>