Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^6: Convertion Perl Script to Exe with PAR::Packer pp

by Corion (Patriarch)
on Jul 25, 2014 at 12:59 UTC ( [id://1095043]=note: print w/replies, xml ) Need Help??


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

No. You get the file embedded in the compiled result.

Maybe you want to explain some more about why you're packaging things and what problems you're actually trying to solve?

  • Comment on Re^6: Convertion Perl Script to Exe with PAR::Packer pp

Replies are listed 'Best First'.
Re^7: Convertion Perl Script to Exe with PAR::Packer pp
by marchiore (Initiate) on Jul 25, 2014 at 13:24 UTC
    The problem is: i create this script to send files attached on a e-mail. The e-mail list is xlsx where i have the colunm 0 with the name and colunm is the e-mail to send than i see the name of the file (is the same value of colunm 0) and send the e-mail. The problem is if i need to change the xlsx i'll have to convert again but this script will run on the user pc.

      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
        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.

      Is there some reason the xlsx file needs to be included in the .exe file? This xlsx file is really part of the program's input, not the program itself. I would suggest enhancing your program to allow the user to specify the xlsx files to use.

      At the very least, I would look for a way to discover the location of the .exe file then look for the xlsx file there.

      Another option would be to tell the users to put the xlsx file in their "My Documents" folder. On Win7, you can find this with:

      $ENV{USERPROFILE} . "\\My Documents\\"

      On other versions of MS Windows, open a cmd window and type set to get a list of the environment variables. Then you can find the one that gets you the closest. Use that and modify the appended path as needed.

        great ideia, i solved it using this solution but using $ENV{HOMEDRIVE} Ty very much!!!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1095043]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2024-04-19 20:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found