Data::Hierarchy::Traverser

Perl extension for generic hierarchy structure traversal
Download

Data::Hierarchy::Traverser Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Ge Peng
  • Publisher web site:
  • http://search.cpan.org/~tigerperl/

Data::Hierarchy::Traverser Tags


Data::Hierarchy::Traverser Description

Perl extension for generic hierarchy structure traversal Data::Hierarchy::Traverser is a Perl module to export one recursive function hierarchy_traverse, which traverses a hierarchy structure in the depth-first fashion.Caution: As it is a recursive function, pay attention of the usage of gobal variables such as $_, < FH >.SYNOPSIS use Data::Hierarchy::Traverser; hierarchy_traverse ( $roots, # a scalar for one root, # or a ref to a list of roots, # or a ref to a list of the wrappers of root. \&get_children, # a function for getting child nodes { # Options: depth => 1, # how depth limitaion. (default undef, no limitation) pre_branch => $per_banch_function, # the function called before visit childeren nodes post_branch => $per_banch_function, # the fucntion called after visite all it children nodes bare_branch => $per_banch_function, # the function for empty branches leaf => $leaf_function, # the function for leaf nodes is_leaf => $is_leaf_function, # the function for check if a node is leaf # all default functions are default to be {} # (do nothing and return false. # (?Should it just skip the call to an empty funcion?) } , ); Requirements: · Perl


Data::Hierarchy::Traverser Related Software