in reply to Vicious circle.

Each line you've read from the file contains a newline at the end of it. Either chomp() the lines, or don't add the newlines!
chomp(my @lines = <INPUT>); # or print OUTPUT @lines;

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart

Replies are listed 'Best First'.
Re^2: Vicious circle.
by nasa (Beadle) on Feb 08, 2006 at 04:07 UTC
    OK But where in the code would I put such <code. chomp(my @lines = <INPUT>); </code> You are fast.
      You'll have to try a little harder than that. You need to chomp() the lines you read from the file. Figure it out.

      Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
      How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart