[Bioperl-l] flushing i/o with TreeIO

Howard Ross h.ross@auckland.ac.nz
Fri, 12 Jul 2002 09:50:48 +1200


This may be a newbie question.

I've been using Bio::TreeIO to manipulate phylogenetic trees. When I use
   my $treeout = new Bio::TreeIO(-format => 'newick', -file =>  $outfile );
   ... stuff ...
   $treeout->write_tree($tree);

(and all the ancillary code) to write the tree to file, I find that the
output is not flushed and hence not available to ordinary reads from the
output file, eg
  while (defined($treeline = <OUTTEMP>)) { ... }

The only solution I have found is to return from the subroutine where the
tree manipulation is happening.

How do I flush output to file, or close the output file, to make it
available for future reads, without having to exit the subroutine?

Thanks,
Howard
-- 
==========================================================
Dr. Howard Ross, Research Fellow,
School of Biological Sciences, The University of Auckland,
Private Bag 92019, Auckland, New Zealand
email: h.ross@auckland.ac.nz phone: 64-9-373-7599 ext 6160
==========================================================