I've got trees in multiple files. I want to pass all the filenames to the perl script and iterate over each tree. You're right there's probably a better way to do it than undef $/; while(<>) {parse($_)}
By the way, I've just installed the github version, and I can't get unnamed nodes out of $tree->resolve(1). This just seems to name the nodes "NodeX", "NodeY" etc rather than rx, ry:
#!/usr/bin/perl
srand(1);
my $tree = parse_tree(
'-format' => 'newick',
'-handle' => \*DATA,
);
$tree->resolve(1);
print $tree->to_newick(-nodelabels=>1);
#can't get e.g ((D,((A,B)mynode1),C)mynode2,E);
#or even ((D,((A,B)mynode1):0.0,C)mynode2,E);
__DATA__
(((A,B)mynode1,C,D)mynode2,E);