chop#

Synopsis#

$char = chop($var);
$char = chop(@list);
chop $var;

Description#

Removes the last character from each argument. Returns the last character removed (from the final argument).

Unlike chomp, chop always removes exactly one character regardless of $/. Operates on each element when given an array. Returns the last character removed. Correctly handles multi-byte UTF-8 characters.

See also#

chomp