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
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 opperatorBecause 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 $@;
print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."
|
---|
In Section
Seekers of Perl Wisdom