David Clarke wrote: > Hi, does anyone know what the new line character value is in Hex for > a text file ? Is it "0d 0a" ?
ASCII newline is 0x0A (decimal 10) On Unix-ish systems, text files end each line with a single newline. On Windows systems, text files end each line with a CR/LF pair (0x0D, 0x0A). However, the underlying stdio library translates this into a single newline on input and translates it back to a CR/LF pair on output (unless you've called binmode on the handle). So from your program's perspective, you still have a single newline at the end of each line. On Mac systems, the terminator is something different (not sure what), but the same concept applies as for Windows AFAIK. > > I'm trying to read in a line of text, chomp it, attach 3 digits at > the end of this line, then write this line to output file. But when I > write it out, the original input line is written out, then a new line > occurs, then my 3 digits appear on a second line. Shouldn't chomp > remove the new line indicator from the input text? Im completely > baffled. Thanks. chomp() removes the line terminator as defined by the special $/ variable. If you haven't messed with $/, it should be working. Let's see your code. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>