Although providing the input and the desired output was much more efficient that asking for the translation into Perl of your command line, and you now have been provided satisfactory answers, I want to come back to this post or yours:

the s2p utility does work, you just did not use it correctly. You just can't expect s2p to translate the "input.txt | column -ts," end of your command line, since this no longer sed code, nor the "sed -e" at beginning, because this is not yet sed code.

For example, trying this shell command:

Code

$ s2p -e 's/^/| /' -e 's/,/,| /g' -e 's/$/,|/'

would have given you a full (and pretty complicated) Perl script.

Having said that, the solution given by FishMonger after you presented the input and the desired output is much simpler and much better.