in reply to Automatic documentation stubs for .pl source

The following should work:
if ($content =~ /^(sub\s+\w+)[^#]*(#.*)?/) { print "$1\n"; print "$2\n" if ($2); }
Hope this helped.
CombatSquirrel.
Entropy is the tendency of everything going to hell.