\n is not the same as newline. Newline is (in ascii) character 0x0A.
\n is the end of line sequence for the target OS (LF on UNIX, CRLF on
Win32, CR on Mac, "END_OF_LINE" on some mythical OS, etc.). This has
bitten me in the past when I wrote code on a Linux box (\n = LF) and
gave it someone on a Win32 box (\n = CRLF) and used this string
"*END*\r\n" to find the end of a line that had both a CR and a LF.
Eventually I changed the code to "*END*\015\012". For more info look at
"perldoc perlport".
On 26 Jun 2001 10:39:57 -0400, Brett W. McCoy wrote:
> On Tue, 26 Jun 2001, Stéphane JEAN BAPTISTE wrote:
>
> > What is chomp ?
>
> It removes a trailing newline from a string:
>
> chomp($line = <FILEH>);
>
> This retrieves a line form an open filehandle and removes the trailing
> newline (\n) from the end. Actually, it chomps off whatever $/ is set to,
> but it is usually used for \n.
>
> -- Brett
> http://www.chapelperilous.net/btfwk/
> ------------------------------------------------------------------------
> CONGRATULATIONS! Now should I make thinly veiled comments about
> DIGNITY, self-esteem and finding TRUE FUN in your RIGHT VENTRICLE??
>
>
--
Today is Boomtime, the 31st day of Confusion in the YOLD 3167
Or not.