Perl 脚本停止。错误:找不到 unicode 属性定义 ASCII
我继承了一些 perl 脚本。 (我不是 Perl 程序员)。
我在下面一行中看到错误 “找不到 unicode 属性定义 ascii”
$value =~ s/[^[:\p{ascii}]]//g
此错误会导致程序执行停止吗?因为这是程序停止之前打印的最后一行。
在放弃之前,同一条线路已经运行了 1000 多次。问题可能是什么?
我倾向于认为 $value 的值并不是导致问题的原因。 我说得对吗?
在我看来,好像 {ascii} 已从 unicode 定义中删除。这可以做到还是我完全找错了树?
I've inherited some perl scripts. (I'm not a perl programmer).
I'm seeing an error "can't find unicode property definition ascii"
on the below line
$value =~ s/[^[:\p{ascii}]]//g
Would this error cause the program execution to stop? As it's the last line printed before the program halts.
That same line has been run over 1,000 times before, before it gives up. What can the problem be?
I leaning towards that the value of $value is NOT what is causing the problem. Am I right?
It seems to me as though {ascii} has been removed from unicode definitions. Can this be done or am I completely barking up the wrong tree?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在我看来,
ascii
必须是大写ASCII
用 \p{ascii} 进行测试:
用 \p{ASCII} 进行测试:
It seems to me that
ascii
must be uppercaseASCII
test with \p{ascii}:
test with \p{ASCII}: