|Main Archive Page > Month Archives > spamassassin-dev archives|
--- Comment #12 from Mark Martinec <Mark.Martinec@ijs.si> 2011-11-02 15:09:49 UTC ---
> Had a quick look to the perlport docs Kevin mentioned, wouldn't it be suitable
> using use Socket qw(:DEFAULT :crlf) instead?
No, that would always produce a \015\012, instead of a local line terminator.
About sanitizing $/, I agree with Karsten in Comment 9 that there is no
need to overdo it. If $/ is not a simple \n or \r\n, we are pretty much
lost in all other places. All we need to deal with is Windows and Unix.
If we end up on a a record-structured files (like VMS) or hypothetical
other weird systems, a simple wrestling with $/ won't work anyway.
As suggested, the PerlIO with :crlf would probably be the cleanest
solution, but buffering and locking on a log file with concurrent accesses
from child processes will get in the way, so it cannot be done lightly
without sufficient testing.
I'm inclined to the original simple approach using am_running_on_windows,
and having a "\n" for everybody else.
Not sure if using this custom line terminator is suitable for
die and warn calls too. If yes, there are hundreds of other calls
like these all over the place. Perl also has some special logic
regarding a \n in a die/warn argument text (to add line number or not).
A minor nit: a variable name $delimiter is not the best choice:
we are dealing with line terminators, not delimiters. And a shorter name
would be handy, as it may eventually end up in other places too.
Perhaps an: $eol .
-- Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.