Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

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 pondering the Monastery: (12)
As of 2016-09-29 12:25 GMT
Find Nodes?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:

    Results (552 votes). Check out past polls.