Perl - UNIX 中与 Windows 不同的排序
我在 Perl 中排序时遇到问题,在 Windows 和 Unix 中结果不同。
这些字符是: a - _ 1 2
In Windows: _ 1 2 - a
In Unix: _ - 1 2 a
我猜语言环境与此有关 - 我该怎么做才能使 Unix 排序与 Windows 排序匹配?
谢谢!
I'm having issues sorting in Perl having different results in Windows and Unix.
The characters are: a - _ 1 2
In Windows: _ 1 2 - a
In Unix: _ - 1 2 a
I'm guessing the locale has something to do with this - what can I do to make the Unix sort match the Windows sort?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
文档说:
所以使用
示例:
The docs say:
so use
Example:
如果您不想使用区域设置,请注释掉包含的行,
如果没有这样的行,Perl 中的
sort
在 Windows 和 Unix 上的行为应该相同。您还可以在
排序
之前添加(或者更好的是,将排序包含在以其开头的块中)。
If you do not want to use locale, comment out the line containing
Without such a line,
sort
in Perl should behave the same on both Windows and Unix.You can also add
before the
sort
(or, better, enclose the sort into a block starting with it).