in reply to To make the comparison work faster

Anonymous Monk,
This is how your code probably should be written based on what little I understand.
#!/usr/bin/perl use strict; use warnings; my $in_file = $ARGV[0] or die "Usage: <file1> <file2>"; my $in2_file = $ARGV[1] or die "Usage: <file2> <file2>"; open(my $fh, '<', $in_file) or die "Unable to open '$in_file' for read +ing: $!"; my %bead; while (<$in_file>) { chomp; my ($snp, $chr, $beadpoolid) = split /,/; $bead{$snp} = $beadpoolid; } open($fh, '<', $in2_file) or die "Unable to open '$in2_file' for readi +ng: $!"; while (<$fh>) { next if ! /^SNP\s+Coor/; chomp; my ($snp, $coor, $allele, @int) = split /\t/; next if ! $bead{$snp}; print join("\t", $bead{$snp}, $snp, @int), "\n"; }

Cheers - L~R