request translation of perl code line

I am not a perl expert by any means.
I have this line of code that reads lines in a file:

%s fs -cat %s | perl -pe 's/\t/,/g' > %s

I want to say that -pe and the string behind it talks about delimiters?

If I wanted to write this line twice, once with tab-only and once with comma-only delimiters,
how do I do it?
Evan CutlerVolunteer Chief Information OfficerAsked:
Who is Participating?
ozoConnect With a Mentor Commented:
perl -MO=Deparse  -pe 's/\t/,/g'
LINE: while (defined($_ = <ARGV>)) {
continue {
    die "-p destination: $!\n" unless print $_;

s/\t/,/g  Searches for tab and replaces it with , /g means match globally, i.e., find all occurrences.

If instead you want to change , to tab, you can do s/,/\t/g
Evan CutlerVolunteer Chief Information OfficerAuthor Commented:
Thanks much.
This got me where I needed to go.

Most appreciated.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.