You need to check that $accession{$g} exists before using it. Something like changing the line
if ($accession{$g} =~ m/$accession_id/i){
to
if (exists $accession{$g} && $accession{$g} =~ m/$accession_id/i){
should do the trick.
EDIT: BrowserUK posted an answer while I was composing mine. His is more comprehensive.
In reply to Re: fasta file
by molecules
in thread fasta file
by PrincePerl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |