in reply to Re: Writing a UNIX text line - the end character challenge
in thread Writing a UNIX text line - the end character challenge

Thanks for that. I can now see that the chomp removes just the Ascii 10 character.
However, my problem concerns writing a file so that when I read it back in there will not be the ASCII 13 character present.
This is because a UNIX text file does not want the ASCII 13 character to be there.
  • Comment on Re^2: Writing a UNIX text line - the end character challenge

Replies are listed 'Best First'.
Re^3: Writing a UNIX text line - the end character challenge
by SuicideJunkie (Vicar) on Aug 11, 2010 at 13:56 UTC

    What you probably want to do is read the file NOT in binmode. If there are CRLFs, they'll get compacted and chomped as normal.

    Writing out, you want to put it in binmode so you get exactly the bytes you specify, and don't have your line endings re-expanded for you.

      That did it!!
      No binmode on input but binmode on output.
      Many thanks
Re^3: Writing a UNIX text line - the end character challenge
by JavaFan (Canon) on Aug 11, 2010 at 15:33 UTC
    This is because a UNIX text file does not want the ASCII 13 character to be there.
    Rubbish. UNIX doesn't care what you put in your files. If you want the ASCII 13 character to be there, write it to the file, and it will be there. If you don't want it to be there, don't write it. UNIX is as simple as that.