if (($fields[16] eq $hwp) && ($fields[18] eq 'Y'))
{
$fields[22] = "INTEGRAL";
}
elsif ($fields[16] eq $hwp)
{
$fields[22] = "INTEGRAL";
}
elsif ($fields[16] ne $hwp)
{
$fields[22] = "SEPARATE";
}
print "$fields[16] $fields[18] $fields[22]\n";
Output:
The problem here is that the first condition is true so it should print INTEGRAL but it is printing SEPARATE.
I am absolutely clueless because the same logic is working fine for another condition in the program.
Cheers,
AK