http://www.perlmonks.org?node_id=551204


in reply to Re^2: chomp() is confusing
in thread Why chomp() is not considering carriage-return

If you want to chomp \r\n, set $/ to \r\n:

local $/ = "\r\n"; $one = "Hello\r\n"; print "Before chomp: " , length($one) , "\n"; chomp($one); print "After Chomp: " , length($one) , "\n";