String Functions
- chomp list†
Removes
$/(page 70) from all elements of the list; returns the (total) number of characters removed.- chop list†
Chops off the last character on all elements of the list; returns the last chopped character.
- crypt plaintext, salt
Encrypts a string (irreversibly).
- eval expr†
Parses and executes expr as if it were a Perl program. The value returned is the value of the last expression evaluated. If there is a syntax error or runtime error, undef is returned by eval, and
$@is set to the error message. See also eval in page 63.- index str, substr [
,offset ] Returns the position of substr in str at or after offset. If the substring is not found, returns –1.
- lc expr†
Returns a lowercase version of expr. See also
\Lin page 7.- lcfirst expr†
Returns expr with its first character in lowercase. See also
\lin page 7.- length expr†
Returns the length in characters of expr.
- quotemeta expr†
Returns expr with all regular expression metacharacters quoted. See also
\Qin page 7.- rindex str
,substr [,offset ] Returns the position of the last substr in str at or before offset. If the substring is not found, returns –1.
- substr expr
,offset [,len [,newtext ] ] Extracts a substring of length len starting at offset out of expr and returns it. If offset is negative, counts from the end of the string. If len is negative, leaves that many characters off the end of the string. Replaces the substring with newtext if specified, otherwise, may be assigned to.
- uc expr†
Returns an uppercase version ...