--- name: chomp status: documented runtime: pp source: src/runtime/pp/strings/chomp.rs --- ```{index} single: chomp; Perl built-in (pp runtime) ``` # chomp ## Synopsis ```perl $count = chomp($var); $count = chomp(@list); chomp $var; ``` ## Description Removes the trailing record separator (default: newline) from each argument. Returns the total number of characters removed. Respects `$/` (input record separator). When `$/` is `undef` (slurp mode), chomp is a no-op. When `$/` is `""` (paragraph mode), removes all trailing newlines. Handles CRLF line endings — `\r\n` counts as 2 characters removed. ## See also chop, $/