in reply to Re: Elegant way to return true or nothing from a subroutine?
in thread Elegant way to return true or nothing from a subroutine?

jasonk,
Actually, the documentation clearly states it does return nothing provided the sub was called in a void context. Unfortunately there isn't a clear way to say:
return defined(wantarray) ? wantarray ? () : undef : NOTHING;

Cheers - L~R

Replies are listed 'Best First'.
Re^3: Elegant way to return true or nothing from a subroutine?
by gaal (Parson) on Oct 10, 2006 at 17:16 UTC
    As fortunately, this never matters, because by definition nobody gets to look at the return value in void context.