$string = "1,2,3\n,4,5,6\n7,8,9";
@array = split(/\n/,$string);
foreach( @array ) {
   $_ =~ s/,//g;
   print $_,"\n";
}

