in reply to Re: Redefining chomp()
in thread Redefining chomp()
As there is no quantifier on your character class, I have trouble understanding how this will remove multiple newlines as you say. Am I missing something?
Also, if the Windows newline is in fact "\r\n", this will not work, again because there is no quantifier.
It seems to me if you instead do
$count += $_ =~ s/\r?\n$//g;
... then you alleviate the problem of killing all trailing newlines and, assuming "\r\n" is what all windows newlines are, you are matching both windows and unix newlines.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Redefining chomp()
by Limbic~Region (Chancellor) on Mar 24, 2004 at 18:42 UTC | |
|
Re^3: Redefining chomp()
by Roy Johnson (Monsignor) on Mar 24, 2004 at 18:48 UTC |