in reply to Re: Dealing with files with differing line endings
in thread Dealing with files with differing line endings

Here an example to overide chomp

use strict; use warnings; package NewChomp; use Data::Dump qw/pp dd/; use subs qw/chomp/; sub chomp { $_[0] =~ s/\n$//; # adjust here } pp my $line ="abcd\n"; chomp $line; pp $line;

Just export it from a new module into your scripts, and adjust the regex to your needs.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

  • Comment on Re^2: Dealing with files with differing line endings (overriding chomp)
  • Download Code