Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: New to Perl

by Utilitarian (Vicar)
on Aug 04, 2011 at 04:38 UTC ( #918436=note: print w/replies, xml ) Need Help??

in reply to New to Perl

Two One things catches my eye straight away....
  • Where do you assign a value to $query?
  • To define %hash you need to map {$hash{$_}=1}@file_data
One final issue you should use strict and use warnings to catch typos and to ensure you have scoped your variables

Update corrected my half asleep error, too little testing of code and coffee

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."

Replies are listed 'Best First'.
Re^2: New to Perl
by chromatic (Archbishop) on Aug 04, 2011 at 05:32 UTC
    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;
      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?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://918436]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2018-05-21 21:23 GMT
Find Nodes?
    Voting Booth?