in reply to Re^7: Convertion Perl Script to Exe with PAR::Packer pp
in thread Convertion Perl Script to Exe with PAR::Packer pp

Aah - that makes it clearer:

my $diretorioScript = dirname(__FILE__); my $excel = Spreadsheet::XLSX->new( "$diretorioScript\\jofalista.x +lsx", );

dirname(__FILE__) is not what you want, because the program will be expanded under C:\TEMP or somewhere.

What you want is documented in PAR::Environment. I guess $ENV{PAR_PROGNAME} is what you want.

my $diretorioScript= $ENV{PAR_PROGNAME} # running under PAR || dirname($0); # running directly

Replies are listed 'Best First'.
Re^9: Convertion Perl Script to Exe with PAR::Packer pp
by marchiore (Initiate) on Jul 25, 2014 at 16:18 UTC
    i've tried
    $PAR::LibCache{$ENV{PAR_PROGNAME}}
    and
    $ENV{PAR_PROGNAME}
    Both of than return:
    Iniciando o envio de e-mails... IO error: opening \jofalista.xlsx for read : No such file or directory + at C:/strawberry/perl/vendor/lib/Archive/Zip/Archive.pm line 572. + Archive::Zip::Archive::read(Archive::Zip::Archive=HASH(0x455268) +, "\\jofalista.xlsx") called at C:/strawberry/perl/site/lib/Spreadshe +et/XLSX.pm line 33 Spreadsheet::XLSX::new("Spreadsheet::XLSX", "\\jof +alista.xlsx") called at gmail_att.pl line 14 Cannot open \jofalista.x +lsx as Zip archive at C:/strawberry/perl/site/lib/Spreadsheet/XLSX.pm + line 33. SYSTEM ERROR in executing gmail_att.pl: 512 at C:/strawberr +y/perl/site/lib/Module/ScanDeps.pm line 1351.

      This is weird. This means that PAR::Environment is inaccurate.

      I don't know how to help further - most likely, you have to dump %ENV and see what is in there once your program is run using PAR.