Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 scrutinizing the Monastery: (14)
As of 2014-09-02 21:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (30 votes), past polls