while (<>) { s/\r/blah/; print $_ || "Empty\n"; }