Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Multiple Conditional Statements

by vsespb (Hermit)
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.


Comment on Re: Multiple Conditional Statements
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1053461]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2014-09-21 21:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (176 votes), past polls