则无法进行任何操作

则无法进行任何操作

You could use the is copy trait to override the normal read-only parameter binding, and force $/ to be a mutable item container inside the routine:method foo ($/ is copy) { ... }这样,可以在例程中使用 .match ,并且可以在 $/中存储新的 Match 对象.但是然后您将无法再访问传递给例程的原始对象,因此无法通过 make 对其进行影响.因此,对于需要使用 .match 的操作方法,使用像您一样的自定义参数名称是可行的方法.This way, using .match inside the routine would work, and would store a new Match object in $/. But then you wouldn't have access to the original Match object passed to the routine anymore, and thus couldn't affect it with make. So for an action method that needs to use .match, using a custom parameter name like you did is the way to go. 这篇关于perl6语法操作:如果不使用$/,则无法进行任何操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-31 08:16