On 1/10/04 wren argetlahm wrote: >--- Piers Cawley <[EMAIL PROTECTED]> wrote: >> This is because 'return undef;' is good, but 'return;' is better. It >> returns the correct, context dependent representation of false. > >That seems to have fixed my problem, but I'm not sure why it works. My >&error($error) is now something to the effect of {print shift; >return;}, but why does that return false?
See below. If the stuff about context isn't totally clear to you, that would be a good area of Perl to study. That's what Piers was referring to above. from perldoc -f return return EXPR return Returns from a subroutine, "eval", or "do FILE" with the value given in EXPR. Evaluation of EXPR may be in list, scalar, or void context, depending on how the return value will be used, and the context may vary from one execution to the next (see "wantarray"). If no EXPR is given, returns an empty list in list context, the undefined value in scalar context, and (of course) nothing at all in a void context. (Note that in the absence of an explicit "return", a subrou- tine, eval, or do FILE will automatically return the value of the last expression evaluated.) (END) 1; - Bruce __bruce__van_allen__santa_cruz__ca__