in reply to Re: Converting percentage into number
in thread Converting percentage into number
Simplifying slightly:
while (<DATA>) { if (/(\d+\.\d+)%/) { print $` . $1 / 100 . $'; } }
But I still prefer my s/// solution as using $` and its friends isn't recommended.
The use of this variable anywhere in a program imposes a considerable performance penalty on all regular expression matches.
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|