Although this question relates to 'BioPerl', the question, I believe, is probably more general than that.
Basically I have produced a Bio::Tree::TreeI object and I am trying to convert that into a string variable.
The only way I can come close to converting that to a string variable is to write that tree to a stream using:
# a $tree = Bio::Tree::TreeI->new() (which I know is an actual tree as it prints to the terminal console)
my $treeOut = Bio::TreeIO->new(-format => 'newick')
$treeOut->write_tree($tree)
The output of ->write_tree is "Writes a tree onto the stream" but how do I capture that in a string variable as I can't find another way of returning a string from any of the functions in Bio::TreeIO