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

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."


Comment on Re: New to Perl
Select or Download Code
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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://918436]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (12)
As of 2014-04-17 16:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (453 votes), past polls