krusty has asked for the wisdom of the Perl Monks concerning the following question:
my @range = (50000 .. 65535); my @ports = (50000..51545,51549,51555..51999,@more);
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}; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: fastest way to compare two arrays
by BrowserUk (Patriarch) on Apr 14, 2011 at 00:47 UTC | |
Re: fastest way to compare two arrays
by GrandFather (Saint) on Apr 14, 2011 at 00:13 UTC | |
Re: fastest way to compare two arrays
by krusty (Hermit) on Apr 14, 2011 at 00:21 UTC | |
Re: fastest way to compare two arrays
by roboticus (Chancellor) on Apr 14, 2011 at 15:23 UTC | |
Re: fastest way to compare two arrays
by pajout (Curate) on Apr 14, 2011 at 08:09 UTC | |
Re: fastest way to compare two arrays
by Cristoforo (Curate) on Apr 15, 2011 at 23:50 UTC | |
Re: fastest way to compare two arrays
by repellent (Priest) on Apr 16, 2011 at 07:16 UTC |