in reply to swapping values between two files

After the declaration of each while loop add a

chomp

(e.g.)
while (<FILE>) { chomp; ... }
--------------
It's sad that a family can be torn apart by such a such a simple thing as a pack of wild dogs

Replies are listed 'Best First'.
Re^2: swapping values between two files
by megatc101 (Initiate) on Feb 18, 2005 at 20:55 UTC
    Hi
    Thanks for your quick reply, but adding chomp after the declaration of each while loop has the same effect as adding after $_ =~ tr/\n/ /; after the values have been swapped.
    In that is removes all of the carriage returns and I end up with a continious stream of text.
    However your suggestion pointed the way to the solution, I've added chomp after the declaration of the second while loop and that appears to have fixed my problem.
    A thousands thanks
      In that is removes all of the carriage returns and I end up with a continious stream of text.

      yes, which is why you also have to change the print to print OUTFILE4 $_, "\n";

Re^2: swapping values between two files
by Roy Johnson (Monsignor) on Feb 18, 2005 at 20:54 UTC
    Make that only for the first while loop. They still want the newline from the second file.

    Caution: Contents may have been coded under pressure.