in reply to Simple Text Conversion

If what you have is a space-separated file (hmm, there's a comma in there too) and you want to change it to a pipe-separated file (and turn the commas into spaces), you want the tr/// operator:
my $data =~ tr/ /|/; $data =~ tr/,//d; # get rid of the comma, if you want
This will transl(iter)?ate the space character into the pipe character, and the comma character into the space character.

If there's a possibility that any of the fields will contain spaces or pipes or commas, look at the Text::CSV module from CPAN. Writing a regex to take care of this will not only test your skills at planning for all contingencies, it will cause you to go bald.