use strict; use warnings; use Text::xSV; my $csv = Text::xSV->new( sep => ':', fh => *DATA, filter => sub {($_ = shift) =~ s/\\{2}/\\/g;$_} ); $csv->bind_fields(qw(foo bar baz qux)); while ($csv->get_row()) { print $csv->extract('qux'), "\n"; } __DATA__ 0005:A:A2:\\\\string 04\\\\ 0005:A:A2:\\\string 04\\\\ 0005:A:A2:\\string 04\\\\ 0005:A:A2:\string 04\\\\