On Thu, Dec 02, 2004 at 05:59:49PM -0600, JupiterHost.Net wrote: > if I make a module, say Foobar.pm how do you make it so if a function > returns false you can die $!; ?
You can't. Or at least not in the sense you want. $! is linked to the current value of errno, which will be set in the underlying C libraries. Its value is undefined except for just after an error has occurred. errno is an int (or it can be thought of as one). When you use $! in a numeric context you get the value of errno. When you use $! in a string context you get the text associated with that error number. It is possible to assign a numeric value to $!, after which $! in a string context will return the text for the error number you assigned, but this is rarely useful, and certainly not the general way you are looking for. Unfortunately perl doesn't have a standard way of coping with this other than using die, eval {} and $@, which might be seen as overkill in some situations. Take a look at $! in perldoc perlvar. -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>