标签: perl
考虑以下Perl代码:
use Smart::Comments; print "${ \return_hello() }\n"; ### ${ \return_hello() } sub return_hello {return 'hello'}
产生输出:
hello ### ${ \return_hello() }
如何才能在智能评论上调用return_hello功能,让其打印hello?
return_hello
hello
答案 0 :(得分:5)
看起来Smart::Comments需要一些帮助才能确定应该调用子程序。添加标签似乎有效:
Smart::Comments
### returns: return_hello()
打印:
### returns: 'hello'