dann > Perl-Metrics-Lite > Perl::Metrics::Lite::Analysis::Util

Download:
Perl-Metrics-Lite-0.08.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

Perl::Metrics::Lite::Analysis::Util - Utility class for PPI::Document operation

STATIC PACKAGE SUBROUTINES ^

Utility subs used internally, but no harm in exposing them for now. Call these with a fully-qualified package name, e.g.

  Perl::Metrics::Lite::Analysis::Util::is_ref($thing,'ARRAY')

get_packages

Arrayref of unique PPI::Statement::Package found in the PPI document.

get_node_length

Takes a PPI node and returns a count of the newlines it contains. PPI normalizes line endings to newlines so CR/LF, CR and LF all come out the same. The line counts reported by the various methods in this class all exclude blank lines, comment lines and pod (the PPI document is pruned before counting.)

is_ref

Takes a thing and a type. Returns true is thing is a reference of type type, otherwise returns false.

syntax highlighting: