perl -e 'print for <{a,b,c}{1,2,3}>'
我只是不明白它是如何工作的.它的工作原理!生产
a1a2a3b1b2b3c1c2c3
在输出上.
有谁知道钻石 *** 作符内部发生了什么?
解决方法 这是代表glob
bing的另一种方式.基本上,curlIEs告诉glob *** 作符将每个逗号分隔的元素放在内部并结合所有可能性. 更清楚的方法是将逗号分开各个输出:
$perl -e 'print join ",",<{a,3}>;'a1,a2,a3,b1,b2,b3,c1,c2,c3
从perldoc -f glob
开始:
总结If non-empty braces are the only wildcard characters used in the glob,
no filenames are matched,but potentially many strings are returned.
For example,this produces nine strings,one for each pairing of
fruits and colors:06001
以上是内存溢出为你收集整理的Perl钻石 *** 作符内部奇怪的事情全部内容,希望文章能够帮你解决Perl钻石 *** 作符内部奇怪的事情所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)