$/ = "\r"; # I'm on Mac OS X. while (<>) { do stuff with $_ };