#!/usr/bin/perl use strict; use warnings; use Text::CSV; my $data = <<'EOF'; 1 Something\,\text\text\0x2B X 99 1,This is a problem->\\,B,2 EOF open my $fh, '<', \$data; my $csv = Text::CSV->new({sep_char => ','}); while (my $row = $csv->getline($fh)) { print "<$_> " foreach @$row; print "\n"; } __DATA__ <1> <\text\text\0x2B> <99> <1> \\> <2>