me too / neither =)
(tried /s but the returned count wasn't for groups)
> the /r flag to tr came in at 5.14. It won’t work on older Perls
If it's that fast using $str twice shouldn't be a big problem.
Should be mentioned that tr is destructive, i.e. a safety copy of the string may be needed too.
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
In reply to Re^6: Can you write a faster code to perform this task?
by LanX
in thread Can you write a faster code to perform this task?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |