chop
chop $var chop @list
- Chops off the last character of a string contained in the variable $var (or strings in each element of a @list) and returns the character chopped. The
chopoperator is used primarily to remove the newline from the end of an input record, but is more efficient thans/\n$//. If no argument is given, the function chops the$_variable.