Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: nested foreach loop, match DNA sequences and calculate score

by roboticus (Chancellor)
on Dec 18, 2012 at 15:38 UTC ( #1009407=note: print w/replies, xml ) Need Help??


in reply to nested foreach loop, match DNA sequences and calculate score

NadjaPadjala:

Your $base1 and $base2 variables aren't arrays, but you're treating them as such. Just try:

if ($base1 eq $base2)

Also, your print $score; statement on line 32 should be inside the curly braces. There may be more issues, but that's all I see at the moment.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1009407]
help
Chatterbox?
[msh210]: doesn't append anything.
[msh210]: It should say "If the last nonempty element of LIST" or "If the string thus to be printed does not end in a newline""
[msh210]: Am I wrong?
[shmem]: no. You're right.
[msh210]: About time... last time I was right was... I don't even remember when.
[shmem]: perl -e 'warn "test$/", ^@^ '
[Eily]: well, at least it's right about warn doing the same thing as die :)
[shmem]: same with undef as last element
[msh210]: oh, good point. It's the best kind of correct
[shmem]: msh210: but I'd not call it a lie outright. That's when you do know the truth.

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (16)
As of 2017-04-24 12:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (439 votes). Check out past polls.