{ sub treeify_r { my $t = pop; $t = [ pop, pop, $t ] while @_; return $t; } } pow : { treeify_r(@{$item[1]}) }