I know it's ugly, but i need to compile a perl script on windows for a client, so basically i am trying to make an .exe out of my .pl script.
I am using PAR::Packer installed via cpan, and i compiled a bunch of simple script before sucessfully.
It worked ok before but it looks not working now since i added use Text::CSV;
It works, but when i run the .exe it gives this error:
Can't locate Text/CSV_PP.pm in @INC (@INC contains: CODE(0x25f1f84) C:\Users\user
\AppData\Local\Temp\par-6b6f6e74757a\cache-6d4baa68e36871e6407210ca47953c635f
81e612\inc\lib C:\Users\user\AppData\Local\Temp\par-6b6f6e74757a\cache-6d4baa6
8e36871e6407210ca47953c635f81e612\inc CODE(0x239f2ec) CODE(0x239f67c)) at (eval
18) line 2.
at script/csvutil.pl line 5.
Compilation failed in require at script/csvutil.pl line 5.
BEGIN failed--compilation aborted at script/csvutil.pl line 5.
Basically what i do is:
pp -o csvutil.exe csvutil.pl
I tried adding forcing loading modules by :
pp -M Text::CSV csvutil.pl
I think i am missing something...
I am working with strawberry perl 5.16
The beginning of code:
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use Text::CSV;
my $file = $ARGV[0];
my @rows;
my $csv = Text::CSV->new ( { binary => 1 ,sep_char => ",",allow_loose_quotes => 1, eol=> $/, always_quote =>1 } ) # should set binary attribute.
or die "Cannot use CSV: ".Text::CSV->error_diag ();
...# basically print all the lines