Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Is there a function similar to the C function strlen() in Perl? That is, is there an easy way to determine how many characters are in a string variable (not an array!)?

Replies are listed 'Best First'.
Re: string variable size
by vroom (His Eminence) on Jan 11, 2000 at 23:24 UTC
    length will do just that.
    $mystring="bob"; $length=length $mystring; print "\$mystring has a length of $length\n";
    In this case length will return 3.