Your code is not working because you have not set the variable $format
to anything, so the Bio::TreeIO class cannot find a class to load for the format. Try this code (it works for me):
#!/usr/bin/env perl
use strict;
use warnings;
use Bio::TreeIO;
my $usage = "$0 treefile\n";
my $infile = shift or die $usage;
my $treeio = Bio::TreeIO->new(-file => $infile, -format => 'newick');
print $treeio->next_tree->as_text('newick');
EDIT: Here is a version using your tree as the input:
#!/usr/bin/env perl
use strict;
use warnings;
use Bio::TreeIO;
my $treeio = Bio::TreeIO->new(-fh => \*DATA, -format => 'newick');
print $treeio->next_tree->as_text('newick');
__DATA__
(((A:5,B:5)90:2,C:4)25:3,D:10);
If we run this code, it prints the tree, as expected.
$ perl so18645089.pl
(((A:5,B:5)90:2,C:4)25:3,D:10);
I'm using BioPerl 1.6.901, the latest version (and the version the documentation on CPAN describes). Version 1.6.0 is very old (>5 years) and is not even on CPAN anymore. I bet if you upgrade, your troubles will disappear.