BEGIN { *CORE::GLOBAL::chomp = sub { my $count; for ( @_ ) { $count += $_ =~ s/[\r\n]$//g; } return $count; } }