in reply to Re^3: Better expression for $x = !!$y||0
in thread Better expression for $x = !!$y||0
And the standard operators like == are expected to return 0 or 1 when a boolean result is expected. (Boolean context will still accept any true value, as in Perl 5, and the short-circuit operators still return one of the input values as the "true" value.),$x = ?$y;
Yes, you can still overload these to return something other than 0 or 1, but it would be construed as antisocial.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Better expression for $x = !!$y||0
by ysth (Canon) on Apr 20, 2005 at 07:07 UTC | |
by TimToady (Parson) on Apr 20, 2005 at 20:00 UTC | |
by ysth (Canon) on Apr 21, 2005 at 19:13 UTC |