Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2016-10-27 07:03 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (353 votes). Check out past polls.