![]() |
|
There's more than one way to do things | |
PerlMonks |
Alternative to bytes::length()by creamygoodness (Curate) |
on Dec 23, 2009 at 01:04 UTC ( #814027=perlquestion: print w/replies, xml ) | Need Help?? |
creamygoodness has asked for the wisdom of the Perl Monks concerning the following question: Greets, I have often seen people badmouth the bytes pragma, but there's one thing I use it for: cheaply identifying empty strings with bytes::length()when the strings may be carrying the SVf_UTF8 flag. The length() function can be inefficient for such strings, because it must traverse the entire buffer counting characters:
Is there an efficient alternative to bytes::length() for this use case elsewhere in core?
Back to
Seekers of Perl Wisdom
|
|