What Fletch said also noted in the docs for Text::CSV:
CHOOSING BACKEND
This module respects an environmental variable called PERL_TEXT_CSV when it decides a backend module to use. If this environmental variable is not set, it tries to load Text::CSV_XS, and if Text::CSV_XS is not available, falls back on Text::CSV_PP;
If you always don't want it to fall back on Text::CSV_PP, set the variable like this (export may be setenv, set and the likes, depending on your environment):
$ export PERL_TEXT_CSV=Text::CSV_XS
% setenv PERL_TEXT_CSV Text::CSV_XS
If you prefer Text::CSV_XS to Text::CSV_PP (default), then:
$ export PERL_TEXT_CSV=Text::CSV_XS,Text::CSV_PP
You may also want to set this variable at the top of your test files, in order not to be bothered with incompatibilities between backends (you need to wrap this in BEGIN, and set before actually use-ing Text::CSV module, as it decides its backend as soon as it's loaded):
BEGIN { $ENV{PERL_TEXT_CSV} = "Text::CSV_PP"; }
use Text::CSV;
Enjoy, Have FUN! H.Merijn
| [reply] [d/l] [select] |
Not used it but that literally looks to be what you're asking for. That module (Text::CSV) is intended to be a backend agnostic module supporting the same interface as the XS backed Text::CSV_XS provides but falling back to its bundled pure perl implementation if that can't be loaded. It doesn't require the XS module (but will use it if available) so you can just write your code to use it and if the XS version is available you'll get the faster (presumably) implementation transparently.
The cake is a lie.
The cake is a lie.
The cake is a lie.
| [reply] |
I'm confused.
Are you actually asking how to install Text::CSV_PP without any attempt to also install the XS backend?
Because both are bundled in the same distribution?
| [reply] |
Because both are bundled in the same distribution?
they're not
| [reply] |
Please elaborate, links are welcome!
| [reply] |
Thanks for all the replie, everyone gets an upvote! | [reply] |