my @names = $os->name( long => 1 ) or next;
That seems more like a strawman to me. I just haven't run into code where people do list assignments in boolean context when using a sub that just returns a single scalar. It is an unnatural construct.
While using a scalar-returning sub as part of some list is done very often.
So subs that never return more than 1 scalar should never use return;. Subs that clearly return a list should avoid using return undef; to indicate failure.
- tye
In reply to Re^5: A question about method return values and error checking (unnatural)
by tye
in thread A question about method return values and error checking
by wee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |