Pod-Perldoc

 view release on metacpan or  search on metacpan

corpus/perlfunc.pod  view on Meta::CPAN

=item chomp( LIST )

=item chomp

This safer version of L</chop> removes any trailing string
that corresponds to the current value of C<$/> (also known as
$INPUT_RECORD_SEPARATOR in the C<English> module).  It returns the total
number of characters removed from all its arguments.  It's often used to
remove the newline from the end of an input record when you're worried
that the final record may be missing its newline.  When in paragraph
mode (C<$/ = "">), it removes all trailing newlines from the string.
When in slurp mode (C<$/ = undef>) or fixed-length record mode (C<$/> is
a reference to an integer or the like; see L<perlvar>) chomp() won't
remove anything.
If VARIABLE is omitted, it chomps C<$_>.  Example:

    while (<>) {
        chomp;  # avoid \n on last field
        @array = split(/:/);
        # ...
    }



( run in 0.448 second using v1.01-cache-2.11-cpan-49f99fa48dc )