"be consistent" | |
PerlMonks |
Re^2: Syntax Perl Version support $c = () = $a =~ /\./gby h2 (Beadle) |
on Jul 17, 2018 at 22:02 UTC ( [id://1218698]=note: print w/replies, xml ) | Need Help?? |
jwkrahn, I had to test this, and lo, as you said, tr/.// is about 80% or so faster. I mean, of course, I'd have to run it thousands of times, but there it is, much faster. Thanks for that tip. I'm not clear on what you meant by this: But note that while the first version will work with strings of any length the second version will only work with characters. The data is a string of varying lengths, and usually is a decimal number.
In Section
Seekers of Perl Wisdom
|
|