Well, now I'm confused... I found that CSV_XS wasn't installed, couldn't install it, so tried CSV, but never went near PP. I can only assume that PP was already installed. Or perhaps CSV installs CSV_PP by default? CSV_PP doesn't appear to be a core module - at least it's not on my linux box or my Win XP machine.
That aside, I'm still a little puzzled. I could presumably have a situation where I've got both CSV_XS and CSV_PP installed, but my script would now fail due to lack of the CSV wrapper? (which makes it seem like the wrapper could be more trouble than it's worth)
Edit to add: It looks like Text::CSV_PP is included when you install Text::CSV, so that makes sense... However, this still means I want to run my own test for CSV_XS, otherwise my script will fail when CSV_XS is there if CSV is not installed... Have I got that right?
map{$a=1-$_/10;map{$d=$a;$e=$b=$_/20-2;map{($d,$e)=(2*$d*$e+$a,$e**2
-$d**2+$b);$c=$d**2+$e**2>4?$d=8:_}1..50;print$c}0..59;print$/}0..20
Tom Melly, pm (at) cursingmaggot (stop) co (stop) uk
| [reply] [d/l] |
Since the pure perl is the fallback solution, and it does not require anything but perl (and well, if you're trying to install Text::CSV you probably have perl on your system), it's not really surprising to see CSV_PP is provided with Text::CSV (it's not installed at the same time, it's part of the module. So you can't have CSV_PP without Text::CSV being installed (or it was done on purpose for some reason)).
I don't see anything preventing Text::CSV_XS being installed without Text::CSV, so indeed, this might be an issue. But Text::CSV with its PP implementation is a fairly simple module: only to .pm files, without any compilation needed (that's actually why it exists, in case the compilation for XS fails), so it should be easy to install even "by hand" (unzip and perl Makefile.PL; make; make test; make install), or even just include without any installation in your program. Besides, its main benefit is that the implementation is abstracted away, and you get one unique interface for all your calls, so no my $csv = Text::CSV_PP->new vs my $csv = Text::CSV_XS->new, you just use Text::CSV and everything in the Text::CSV namespace will point to the right element, which was your second problem :) .
| [reply] [d/l] [select] |