Juerd has asked for the wisdom of the Perl Monks concerning the following question:
Hi fellow monks,
Should or should it not be possible that s/.// increases a string's length (as reported by length)?
I think it should not be, but if it for any reason should, please let me know.
It is possible to create a string, s/.// it, and have a length that is greater than the length before the substitution was made. The only thing I ask is if it should be possible.
As a little background information, I quote from perldoc -f length:
Greetings,
Juerd
Should or should it not be possible that s/.// increases a string's length (as reported by length)?
I think it should not be, but if it for any reason should, please let me know.
It is possible to create a string, s/.// it, and have a length that is greater than the length before the substitution was made. The only thing I ask is if it should be possible.
As a little background information, I quote from perldoc -f length:
Returns the length in characters of the value of EXPR.And a bit from perldoc perlre:
. Match any character (except newline)
Greetings,
Juerd
Back to
Seekers of Perl Wisdom