in reply to nested if statement wont work
open(FILE, ">$ffdb"); foreach my $line (@ffdbdata) { chomp $line; # <--- use this instead of s/\n//g my @column=split /\|/, $line; # <-- no need for quotes: "$line" if( $column[0] == $ID ){ $column[1] = $column[1] eq 'IN' ? 'OUT' : 'IN'; # flip the value } print FILE join("|", @column), "\n"; # do one write statement } close FILE;
|
|---|