#!/usr/bin/perl use warnings; use strict; use Text::CSV; my $csv = Text::CSV->new; open my $FH, '<', '1.csv' or die $!; while (my $row = $csv->getline($FH)) { s/,/~/g for @$row; $csv->combine(@$row); print $csv->string, "\n"; }