[Bioperl-l] problem parsing a newick format

Hilmar Lapp hlapp at gmx.net
Thu Feb 12 15:53:47 UTC 2009


On Feb 12, 2009, at 10:07 AM, Mark A. Jensen wrote:

> +    if ( defined($fh) && !ref($fh) ) {
> +       $self->throw("file handle $fh doesn't appear to be a handle");
> +    }


You could go beyond that (a hashref would probably not do fine as a  
filehandle?) and test for it being a symbol.

But the ref test alone will catch the most common case, which is  
passing a file name.

	-hilmar
-- 
===========================================================
: Hilmar Lapp  -:-  Durham, NC  -:-  hlapp at gmx dot net :
===========================================================






More information about the Bioperl-l mailing list