Re: Explanation of Perl one-liner required
by moritz (Cardinal) on Sep 28, 2009 at 11:01 UTC
|
| [reply] |
Re: Explanation of Perl one-liner required
by jakobi (Pilgrim) on Sep 28, 2009 at 11:16 UTC
|
rewrite the options to something 'more standard', then it's easier to read (I ignored the p being hidden in plain sight due to pi.bak and was also wondering for a sec):
perl -w -i.bak -pe 's/Text::CSV/Text::CSV_XS/g' FILE_BEING_EDITED
:)
Peter
| [reply] [d/l] |
Re: Explanation of Perl one-liner required
by Anonymous Monk on Sep 28, 2009 at 11:19 UTC
|
This is indeed a peculiar structure which will universally fix old Text::CSV installations and upgrade them. You can read more about it by doing perldoc Text::CSV::Upgrade (you will need a version of Text::CSV newer than 0.59, if you don't have that installed, just download it from CPAN and execute the command in the untarred directory).
| [reply] [d/l] |
|
|
| [reply] [d/l] [select] |
|
|
| [reply] |
|
|
You're missing the context. He doesn't have a modern Text::CSV, and it's easier instructing this particular monk to install Text::CSV_XS (simple ppm command) than to have him upgrade Text::CSV (which would require installation of make tools, an exercise requiring at least 5 posts to explain to this monk).
| [reply] |
|
|
|
|
|
|
|
|
|
Forgot, sorry, the more correct invocation is
perl -peb.cak -we"s{Text::CSV}{Text::CSV_XS}g" xx.pm
| [reply] [d/l] |
|
|
| [reply] |
|
|
|
|