Sure you do.

If something stops working, go back and look at what worked. Your OP had:

my $gb=new Bio::DB::GenBank;
Now this is actually deprecated syntax and should be written as:
my $gb = Bio::DB::GenBank->new();
... but either style shows the point: you need to call the new() method to get an instance of the class Bio::DB::GenBank, aka, an object, and store it in $gb. Your existing code just assigns the bareword 'Bio::DB::GenBank' to $gb -- or tries to, but barewords are not allowed in your script because you're sensibly using strict. This is a great example of why to use strict: it tells you exactly what the problem is and where to find it.

Also, don't use File::Slurp, it's broken. Use File::Slurper or Path::Tiny.

Hope this helps!


The way forward always starts with a minimal test.

In reply to Re^3: Get Fasta file with Protein Sequences given a file with Genbank Ids using Perl by 1nickt
in thread Get Fasta file with Protein Sequences given a file with Genbank Ids using Perl by dimitris852

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.