in reply to Maximum string length

try:
my $l = do{ use bytes; length $my_string }; print $l;
There is a difference, if your string is a UTF8 string and you use perl 5.8.x
Boris