Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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?
[stevieb]: interestingly enough, someone else got my Devel::Examine:: Subs distribution for their PRC, and I applaud the change. This dist is extremely complicated and mostly obfu, but the person doing it understood PPI enough to change...
[stevieb]: ...something I had overlooked in the extreme depths of the core functionality. After merging, then a couple of extra tweaks, I still have 100% test coverage. Yay for people who write tests!

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2017-01-24 01:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (199 votes). Check out past polls.