Re^2: Explanation of Perl one-liner required
by CountZero (Bishop) on Sep 28, 2009 at 12:21 UTC
|
I do not agree. A modern Text::CSV will use the XS-version if available and the Pure Perl version if XS is not available. So there is no need to "upgrade" your scripts. As per the docs: Text::CSV provides facilities for the composition and decomposition of comma-separated values using Text::CSV_XS or its pure Perl version. If there is anything you should do, then it is to replace Text::CSV_XS by Text::CSV to make your script more universally applicable.
CountZero A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
| [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] |
|
|
| [reply] |
|
|
|
|
|
|
Re^2: Explanation of Perl one-liner required
by Anonymous Monk on Sep 28, 2009 at 11:21 UTC
|
Forgot, sorry, the more correct invocation is
perl -peb.cak -we"s{Text::CSV}{Text::CSV_XS}g" xx.pm | [reply] [d/l] |
|
|
| [reply] |
|
|
No typo, just a persistant case of lazy trolling on the part of the OP. Try searching for acronyms :-)
| [reply] |
|
|