in reply to Re: Syntax Perl Version support $c = () = $a =~ /\./g
in thread Syntax Perl Version support $c = () = $a =~ /\./g
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Syntax Perl Version support $c = () = $a =~ /\./g
by mr_mischief (Monsignor) on Jul 17, 2018 at 23:12 UTC | |
by morgon (Priest) on Jul 18, 2018 at 00:09 UTC | |
by choroba (Cardinal) on Jul 18, 2018 at 00:13 UTC |
In Section
Seekers of Perl Wisdom