in reply to Polysignant variables
OTOH, ||= is very cool, and maintainable, in using it to set default values when none are provided:
(Of course, this assumes that the value on the left is in some 'error' state if it's zero or undef.)sub mysub($$;$) { my ( $a, $b, $c ) = @_; $c ||= 3; #c is 3 if not already defined }
Not that &&= doesn't have it's usefulness while being maintainable, eg:
my $flag = 1; foreach (@item) { $flag &&= usable( $_ ); } print $flag ? "All usable" : "not all usable";
-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain
|
|---|