if ($content =~ /^sub\s+(\w+)[^#]*(?:#(.*))?$/) { print "Subname: $1\n"; print "Comment: $2\n" if defined $2; }
Note that it will fail to catch subs with attributes, or subs with a fully qualified name.
Abigail
In reply to Re: Automatic documentation stubs for .pl source
by Abigail-II
in thread Automatic documentation stubs for .pl source
by Foggy Bottoms
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |