Consider the following Perl code:
use Smart::Comments;
print "${ \return_hello() }\n";
### ${ \return_hello() }
sub return_hello {return 'hello'}
produces the output:
hello
### ${ \return_hello() }
How could I call the return_hello function right 开发者_如何转开发on the smart comment to get it to print hello?
Looks like Smart::Comments needs a little help to determine that a subroutine should be called. Adding a label seems to work:
### returns: return_hello()
which prints:
### returns: 'hello'
加载中,请稍侯......
精彩评论