Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: fastest way to compare two arrays

by repellent (Priest)
on Apr 16, 2011 at 07:16 UTC ( #899738=note: print w/ replies, xml ) Need Help??


in reply to fastest way to compare two arrays

use Set::IntSpan::Fast;

my $range = Set::IntSpan::Fast->new('50000-65535'); my $ports = Set::IntSpan::Fast->new('50000-51545,51549,51555-51999'); my $unused = $ports->copy; $unused->invert; my $unused_in_range = $range->intersection($unused); my $first_unused = ($unused_in_range->iterate_runs->())[0];


Comment on Re: fastest way to compare two arrays
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (12)
As of 2015-07-08 04:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (94 votes), past polls