Help for this page

Select Code to Download


  1. or download this
     my @nodes = $tree->traverse( $tree->PRE_ORDER );
    
  2. or download this
    use Tree (); 
    my %nodes; 
    ...
    die("Invalid data: Multiple roots\n") if @roots > 1; 
    my $root = $roots[0];