in reply to if multiple arg return or single fail?

Can you return an empty list on failure?

sub mysub { ... ... or return (); ... return ( $x, $y ); }

If so, your code will work as is. List assignment in scalar context returns the number of elements to which the RHS evaluates. That means if the function return zero values, the assignment returns zero to the "if".

Currently even when I return 0, if it's written above, it thinks it's passed.

That's one value, so the assignment returns one.

Replies are listed 'Best First'.
Re^2: if multiple arg return or single fail?
by raybies (Chaplain) on Mar 07, 2011 at 16:52 UTC
    Thanks, Ikegami! Hooked on Perlmonks worked for me. :) --Ray