in reply to searching through data

I would use a hash, like so (untested code warning):
use strict; use warnings; my @array; # contains numbers (1..1000000) ~ 400000 numbers my %hash; open (in , "<", "in.txt") || die "$!"; while(<in>){ m/^(\d+)/; $hash{$1} = 1; } close in; foreach my $num (@array) { print "$num, " if exists $hash{$num}; }


-pete
"Worry is like a rocking chair. It gives you something to do, but it doesn't get you anywhere."