in reply to Automatic documentation stubs for .pl source
@parsed receives the captured matches. The captured matches will be the sub portion, followed by either the comment or nothing (using alternation, grouped by non-matching parens).
my @parsed; if ( @parsed = $content =~ /^\s*(sub\s+\w+).+?(?:(#.+)|())$/ ) { local $, = "\n"; print @parsed; }
Dave
"If I had my life to do over again, I'd be a plumber." -- Albert Einstein
|
|---|