$line =~ s/,//g; # or, another way to get the same result: $line =~ tr/,//d;