in reply to Replacing commas with pipes
As this doesn't seem to be for purely educational purposes, I'd recommend using Text::CSV, instead of reinventing the wheel...