in reply to Building If Statements

my $PERcode = (split(/,/,$line2))[0]; my $FDXcode = (split(/,/,$line2))[1]; ...

is better written as

my ($PERcode,$FDXcode,...)= split /,/,$line2;

Apart from that I really have a hard time understanding what you want to do, especially since you put everything in code tags. For example, what is this:

if field1 ne "" field7 ne ""

Is this the code your are trying to parse? Because it doesn't look like perl

Would it work for you if you wrote just this:

if ($CODE1 eq $PERcode) && ($QSIGN1 eq '' or $QSIGN eq $QSIGN1) && ($A +SIGN eq '' or $AMTSIG eq $ASIGN) ...

This ignores any empty fields and just compares the fields that are set

UPDATED