![]() |
|
Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Is there any way to ignore certain words and keep it as it is when substituing hash values to a matched pattern in a string?by skooma (Novice) |
on Apr 02, 2018 at 09:04 UTC ( #1212142=perlquestion: print w/replies, xml ) | Need Help?? |
skooma has asked for the wisdom of the Perl Monks concerning the following question: So I have a regex in perl which goes like,
My question is, How do I ignore "log10" and only match "blackcat" for substitution? So that I can evaluate that "$texttosub" line and print of the log10 value of that "blackcat". What I am looking for is, say blackcat=>5, whitecat=>10,orangecat=>20, then, $texttosub = "log10(blackcat)*whitecat*(log10(orangecat))" ===>must become log10(5)*10*(log10(20)). I tried this,
But I am getting an infinite loop for some reason. Thanks in advance.
Back to
Seekers of Perl Wisdom
|
|