$tree->{data}='stuff';' $tree->{children}=[{},{},{}]; #### sub parse { my $t=shift; print $t->{data}; if(@{$t->{children}}){ for(@{$->{children}}){ parse($_);} }} }