IO::Handle->format_line_break_characters( [STR] ) $: IO::Handle->input_record_separator( [STR] ) $/ #### IO::Handle->input_record_separator( ["\r"] ); #### #!/usr/local/bin/perl use strict; use warnings; use Data::Dumper; use IO::File; use Text::CSV_XS; IO::Handle->input_record_separator( "\r" ); my $file = defined $ARGV[0] ? $ARGV[0] : 'normal.txt'; my $io = new IO::File "$file", "<" || die "horribly"; my $csv = new Text::CSV_XS; # my $test = $io->getline; # print Data::Dumper->Dump([$test],['io']); my $columns = $csv->getline($io); print Data::Dumper->Dump([$columns],['csv']); exit 0; #### cat mac.txt | perl -e '$/="\r"; while(<>){$_=~s/\015$/\n/; print $_;}'