I've installed Active State Perl v5.8.7 (b.813) on my Windows XP machine. I then downloaded five modules, unzipped them, and copied the pm files to appropriate directories under C:/Perl/lib/.. creating folders as needed. (is there an 'install' procedure I must run to install modules?)
http://search.cpan.org/~alancitt/Text-CSV-0.01/CSV.pm -> ../lib/Text/CSV
http://search.cpan.org/~jwied/Text-CSV_XS-0.23/CSV_XS.pm -> ../lib/Text/CSV
http://search.cpan.org/~tmtm/Text-CSV-Simple-0.20/lib/Text/CSV/Simple.pm -> ../lib/Text/CSV
http://search.cpan.org/~miyagawa/Class-Trigger-0.09/lib/Class/Trigger.pm -> ../lib/Class/
http://search.cpan.org/~mschwern/Class-Data-Inheritable-0.02/lib/Class/Data/Inheritable.pm -> ../lib/Class/Data/
I'm using the wrapper code:
#!/perl/perl -w
use strict;
use Text::CSV::Simple;
my ($parser, @data);
my $datafile = 'datafile.csv';
my $csvout = 'csvout.csv';
push (@INC,'c:/Perl/lib/Text/CS
V');
# Only want certain fields?
$parser = Text::CSV::Simple->new;
$parser->want_fields(1, 2, 4, 8);
@data = $parser->read_file($datafi
le);
open (CSV, "> $csvout") or die "can't open $csvout $!";
print CSV @data;
close CSV;
I am getting the following error:
C:\>perl test.pl
Can't locate Text/CSV_XS.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .)
at C:/Perl/lib/Text/CSV/Simpl
e.pm line 18.
BEGIN failed--compilation aborted at C:/Perl/lib/Text/CSV/Simpl
e.pm line 18.
Compilation failed in require at test.pl line 4.
BEGIN failed--compilation aborted at test.pl line 4.
Start Free Trial