On Aug 16, 2011 11:02 AM, "ANJAN PURKAYASTHA" <anjan.purkayas...@gmail.com>
wrote:
>

> I wrote a short test script for the Bio::DB::Taxonomy module:
> ================================================
> #!/usr/bin/perl -w
> use strict;
> use Bio::DB::Taxonomy;
>
> my ($nodesfile, $namesfile)= ('nodes.dmp', 'names.dmp');
>
> my $db= new Bio::DB::Taxonomy(-source    => 'flatfile',
>                              -nodesfile => $nodesfile,
>                              -namesfile => $namesfile
>                              );
>
> my $bacteria= $db->get_Taxonomy_Node(-taxonid => '2');
> print("$bacteria->id\t$bacteria->name\n");
> ================================================
>
> For those of you who don't use BioPerl, the command
> "$db->get_Taxonomy_Node(-
> taxonid => '2')" returns a Bio::Taxon object.
>
> After the execution of the print statement I expect to see the ouput " 2
> Bacteria".
>
> Instead I get a warning:
> UNIVERSAL->import is deprecated and will be removed in a future perl at
> /usr/share/perl5/vendor_perl/Bio/Tree/TreeFunctionsI.pm line 94.
>

Your warning is because the maintainer put a 'warn' when you call that
function. It is probably documented in the pod (or should be) that that
method call is depreciated and you should do this another way.

> and the following ouput:
> Bio::Taxon=HASH(0x158dbe0)->id    Bio::Taxon=HASH(0x158dbe0)->name
>
> The script seems to be working but there seems to be a problem with
> dereferencing a Bio::Taxon object.
>

The later, you'll see with Data::Dumper (but you might consider moving to
the new method first).

Reply via email to