Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 ( [id://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."

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-03-28 13:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found