You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PPI::Statement::Sub can correctly parse subs from a module like this
use PPI;
my $FILE = "Module.pm";
my $doc = PPI::Document->new($FILE);
my $subs = $doc->find('PPI::Statement::Sub');
foreach my $sub (@$subs) {
print $sub->name;
}
However when it comes to parsing special subs defined as another keywords, consider:
use PPI:
use Future::AsyncAwait; # provides a DSL to define 'async' subs
my $FILE = "AsyncModule.pm";
my $doc = PPI::Document->new($FILE);
my $subs = $doc->find('PPI::Statement::Sub');
foreach my $sub (@$subs) {
print $sub->name;
}
Where the AsyncModule.pm may look like this:
async sub do {
...
}
sub that { ... }
1;
The output of the above script would be only
that
Is there a way to output do also? If not can it be supported?
The text was updated successfully, but these errors were encountered:
PPI::Statement::Sub
can correctly parsesubs
from a module like thisHowever when it comes to parsing special subs defined as another keywords, consider:
Where the
AsyncModule.pm
may look like this:The output of the above script would be only
Is there a way to output
do
also? If not can it be supported?The text was updated successfully, but these errors were encountered: