# Find all the named subroutines my @subs = $Document->find( sub { $_[1]->isa('PPI::Statement::Sub') and $_[1]->name } ); #### my @subs; $document->find( sub { if($_[1]->isa('PPI::Statement::Sub') && $_[1]->name()) { push @subs, $_[1]->name(); } });