chomp
chomp $var chomp @list
- Removes any line-ending characters of a string in $var, or each string in @list, that correspond to the current value of
$/(not just any last character, aschopdoes).chompreturns the number of characters deleted. If$/is empty (in paragraph mode),chompremoves all newlines from the selected string (or strings, ifchomping a list). If no argument is given, the functionchomps the$_variable.