http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5748
------- Additional Comments From [EMAIL PROTECTED] 2007-12-25 17:56 -------
> Making this completely platform independent would, I think, be done by
> requiring File::Sort. What are people's opinions as to which way is best,
> conditionalizing the code by platform, adding a new dependency for
> File::Sort, or something else I haven't thought of?
If the only problem is locale, and a system sort command works for
most common platforms, I'd prefer the system's sort.
There is a problem though with the proposed patch:
open(my $fh, "LC_ALL='C' sort $FILE |")
It requires that Perl invokes a sort through a shell,
and even more specifically, through a bourne-compatible shell.
Setting an environment variable in a Perl process, before forking
off a sort, is more portable, and avoids shell. E.g.:
{ local $ENV{LC_ALL} = "C";
open($fh, "sort |") or die "err: $!";
}
...read or whatever...
# read ruleset name from the first line in the file
my $ruleset_name;
$_ = <$fh>;
Perhaps setlocale could be used instead of env var, e.g.:
use POSIX ();
POSIX::setlocale(LC_ALL,"C");
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.