Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Multiple Conditional Statements

by vsespb (Chaplain)
on Sep 11, 2013 at 11:07 UTC ( #1053461=note: print w/replies, xml ) Need Help??


in reply to Multiple Conditional Statements

possible solution:
use strict; use warnings; my ($x, $y, $z, $w) = (1, 2, 3, 4); my @A = sort { $a <=> $b } $x, $y, $z, $w; my $ok = 1; while (@A) { $ok = 0 if @A >= 2 && $A[0] == $A[1]; shift @A; } print $ok;
UPD:
fixed: sort should be numerical.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1053461]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2017-02-22 05:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (324 votes). Check out past polls.