Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

fastest way to compare two arrays

by krusty (Hermit)
on Apr 13, 2011 at 23:59 UTC ( #899314=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @range = (50000 .. 65535);
    my @ports = (50000..51545,51549,51555..51999,@more);
    
  2. or download this
    my @hash{@ports} = (1) x @ports; #set indices to true for ports in use
    my $open_port;
    foreach my $port (@range){
       $open_port = $port and last unless $hash{$port};
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://899314]
Approved by GrandFather
help
Chatterbox?
[Discipulus]: hello there: Lady_Aleena for inspiration random browse my homenode.. ;=)
[Lady_Aleena]: Discipulus, Hello there. How are you?
[Lady_Aleena]: Good GUH Discipulus! Do you have enough links there?

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2017-09-24 18:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (274 votes). Check out past polls.

    Notices?