my $deparsed_tree = $tp->deparse(); print $deparsed_tree; # or in array context you get an array of lines my @lines = $tp->deparse(); print join "\n" => @lines;