[Bioperl-l] problem parsing a newick format

Mark A. Jensen maj at fortinbras.us
Thu Feb 12 16:13:52 UTC 2009


right you are- I committed

    if ( defined($fh) && !(ref($fh) && ((ref($fh) eq "GLOB") || 
$fh->isa('IO::Handle')))  ) {
 $self->throw("file handle $fh doesn't appear to be a handle");
    }

in keeping with style further up in the code at this point-
MAJ
----- Original Message ----- 
From: "Hilmar Lapp" <hlapp at gmx.net>
To: "Mark A. Jensen" <maj at fortinbras.us>
Cc: "bioPerl List" <bioperl-l at lists.open-bio.org>; "Chrysanthi A." 
<chrysain at gmail.com>
Sent: Thursday, February 12, 2009 10:53 AM
Subject: Re: [Bioperl-l] problem parsing a newick format


>
> 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 :
> ===========================================================
>
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
> 




More information about the Bioperl-l mailing list