open (my $fh, '<', $allmac) or die "Can't open file '$allmac' for reading: $!"; while (my $line = <$fh>) { ....