大佬教程收集整理的这篇文章主要介绍了在Perl中,当’use strict’打开时,如何将Tie :: IxHash与字典一起使用?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
当我执行以下代码段时:
use Strict; our %foo; use Tie::IxHash; tie (%foo,Tie::IxHash);
它失败了:
Bareword "Tie::IxHash" not allowed while "Strict subs" in use at /nfs/pdx/home/rbroger1/tmp.pl line 4. Execution of /nfs/pdx/home/rbroger1/tmp.pl aborted due to compilation errors.
当use Strict打开时,如何让Tie :: IxHash工作?
dsolimano的例子有效.
use Strict; our %foo; use Tie::IxHash; tie (%foo,"Tie::IxHash"); $foo{C} = 3; $foo{B} = 2; $foo{a} = 1; print keys(%foo);
打印:
cba
没有领带…… Tie :: IxHash这是它
cab
以上是大佬教程为你收集整理的在Perl中,当’use strict’打开时,如何将Tie :: IxHash与字典一起使用?全部内容,希望文章能够帮你解决在Perl中,当’use strict’打开时,如何将Tie :: IxHash与字典一起使用?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。