如何在Perl Smart::Comment上调用函数?
考虑以下Perl代码:如何在Perl Smart::Comment上调用函数?,perl,Perl,考虑以下Perl代码: use Smart::Comments; print "${ \return_hello() }\n"; ### ${ \return_hello() } sub return_hello {return 'hello'} 生成输出: hello ### ${ \return_hello() } 我如何在智能注释上正确调用return\u hello函数来打印hello?看起来需要一些帮助来确定是否应该调用子例程。添加标签似乎有效: ### returns: ret
use Smart::Comments;
print "${ \return_hello() }\n";
### ${ \return_hello() }
sub return_hello {return 'hello'}
生成输出:
hello
### ${ \return_hello() }
我如何在智能注释上正确调用return\u hello
函数来打印hello
?看起来需要一些帮助来确定是否应该调用子例程。添加标签似乎有效:
### returns: return_hello()
其中打印:
### returns: 'hello'
###返回:“你好”