in reply to Re: New to Perl
in thread New to Perl

To define %hash you need to map {$hash{$_}=1}@file_data

Did the querent update the OP? This works just fine (and is less abusive):

my %hash = map { $_ => 1 } @file_data;

Replies are listed 'Best First'.
Re^3: New to Perl
by rolandomantilla (Novice) on Aug 04, 2011 at 20:21 UTC
    The $query is suppose to be the key for the hash which will be the the ID from the FASTA sequence

      Is the solution as simple as using chomp on the lines of your array?

        no ok it can't be. Ok let me see if I can explain it a different way and tell you what the program needs to do. First ask me to enter the clone ID. After i enter the ID using something like $id=<STDIN>; search thru my FASTA file and give me as an answer the sequence from the ID I put in, do you get me? by the way I can't thank you enough for helping me