my $res = $Doc->find ( sub { if ($_[1]->class eq 'PPI::Statement') { # find all PPI::Token::Words within the statement that have # literal equal to Mod::func # non-zero return means it found something $_[1]->find(sub { $_[1]->isa('PPI::Token::Word') and $_[1]->literal eq 'Mod::func'; }) } else {return 0;} } );