my $data =~ tr/ /|/; $data =~ tr/,//d; # get rid of the comma, if you want