I don't see any obvious problems, but I would make your script produce more verbose output so it is clear what is going on (at least for debugging purposes):
open(FILE, "<", "mahi.txt") or die "Unable to open mahi.txt: $!";
while (<FILE>) {
chomp;
print "Looking up PART_NUMBER: >$_<\n";
$sth->execute($_) or die "execute failed: ".$sth->errstr;
my ($dup) = $sth->fetchrow_array();
print " Query returned: >$dup<\n";
if ($dup eq $_) {
print " PART_NUMBER $_ is present\n";
} else {
print " Failed to locate PART_NUMBER >$_<\n";
}
}
If you run this script perhaps it will tell you more about what is failing.