$ perl -le '$foo = "foo\r\n"; $/ = "\r\n"; print chomp $foo; print length $foo' 2 3