while (my $ptfkey = ) #### while () { $ptfkey = $_; # you can skip this using above suggestion $ptfpn = $ptfkey; # don't need this if just matching $ptfpn =~ m/^(\w+)/; # if only letters and numbers $ptfpn =~ m/^([\d\-\.]+)/; # if it's a float $F1hash{$1} = 1; } #### if ($PartNumber =~ $Flhash{$PartNumber}) { #### if (exists $F1hash{$PartNumber}) { #### #!c:\perl\bin\perl -w # note the addition of the -w use diagnostics; use strict;