Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Can any Perl Monk help me to correct the mistake in counting motifs in a string in the perl program written by me?

by Utilitarian (Vicar)
on Dec 12, 2011 at 10:43 UTC ( #943061=note: print w/ replies, xml ) Need Help??


in reply to Can any Perl Monk help me to correct the mistake in counting motifs in a string in the perl program written by me?

This is a public message board, why would I send a solution to you without it being available to other monks to learn from? (and me to show off with of course)

From perldoc perlop and searching for transliteration we discover that

Because the transliteration table is built at compile time, neither th +e SEARCHLIST nor the REPLACEMENTLIST are subjected to double quote interpolation. That means that if you w +ant to use variables, you must use an eval(): eval "tr/$oldlist/$newlist/"; die $@ if $@;
So that may be part of your issue, or at least it will be when you remove the g modifier which makes no sense with athe tr opperator

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


Comment on Re: Can any Perl Monk help me to correct the mistake in counting motifs in a string in the perl program written by me?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (10)
As of 2014-10-23 03:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (123 votes), past polls