in reply to Can If-then conditions do ($a = $b = $c) type expressions?
Enter Quantum::Superpositions
use Quantum::Superpositions; my $a = my $b = my $c = 5; if ( all( $a, $b, $c) == 5) { print "They are all 5\n"; } else { print "They are not the same\n"; }
Or more generally
use Quantum::Superpositions; my $a = my $b = my $c = 5; if ( all($a, $b, $c) == all( $a, $b, $c) ) { print "They are the same\n"; } else { print "They are not the same\n"; }
Update: The second idiom is better written as:
if ( all($a, $b, $c) ) { print "They are the same\n"; } else { print "They are not the same\n"; }
HTH,
Charles K. Clarkson
Clarkson Energy Homes, Inc.
|
---|
In Section
Seekers of Perl Wisdom