in reply to Extract data from web page!

Don't re-invent the wheel. Use Bio::DB::GenBank.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Replies are listed 'Best First'.
Re^2: Extract data from web page!
by Anonymous Monk on May 27, 2012 at 20:29 UTC
    Hm, that's great, thanks! I seem to be having some trouble though, probably I'm not good in handling objects...
    I tried using the snipet they have as example:
    use Bio::DB::GenBank; $gb = Bio::DB::GenBank->new(); $seq = $gb->get_Seq_by_gi('405830'); # GI Number print $seq;

    and I got:
    Bio::Seq::RichSeq=HASH(0xa49c0b4)

    as a response... What must I do to get the sequence, like in here?
    http://www.ncbi.nlm.nih.gov/nuccore/405830?report=fasta

      Something like this?

      use 5.010; use strict; use Bio::DB::GenBank; my $gb = Bio::DB::GenBank->new(); my $seq = $gb->get_Seq_by_gi('405830'); # GI Number say $seq->display_id; say $seq->desc; say $seq->seq;
      perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'