Help for this page

Select Code to Download


  1. or download this
    traverse($in, 0, 0, sub {print ' ' x $_->{dept},'-',$_->{comm},"\n";})
    +;
    
    ... later in the code...
    
    traverse($in, 0, 0, sub {$sth->execute($dept, $comm)});
    
  2. or download this
    sub _print {
       print ' ' x $_->{dept},'-',$_->{comm},"\n";
    }
    
    traverse($in, 0, 0, \&_print);
    
  3. or download this
    sub print_tree {
       push(@_, 0, 0, sub {print ' ' x $_->{dept},'-',$_->{comm},"\n";});
    ...
    }
    
    print_tree($in);