Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Par::Packer, include conf files or not ?

by HJO (Acolyte)
on Sep 24, 2012 at 09:01 UTC ( #995319=perlquestion: print w/ replies, xml ) Need Help??
HJO has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

So here is my situation : I developped a Perl script on Red Hat Stawberry Perl to communicate with an SAP system. I'd like to deploy this script in various environnements (Windows, Red Hat, Open SUSE, ...) and to do so I did my research and discovered pp (PAR::Packer) that seems to answer my problems.

I'd like to create a file that can run on standalone and by standalone I mean : Perl itself does not have to be installed on the destination systems, neither does the modules I'm using (I know that this operation will hide the source code but that's also something I'm looking for...).

I tried to install PAR::Packer from CPAN on my developpment environnement, but the installation failed, so I'm having one major question about PAR::Packer that I'd like to be answered (I cannot run the tests myself) :

I use Log::Log4perl, and the configuration of my logger is written and loaded from a root-logger.conf file. My question is : Do I need to include that root-logger.conf in the files that PAR::Packer will package (like I'd add a library) or will my module still be able to read it if I leave it "outside" the packaged file ? Or to be clearer : Do I need to include every configuration file related to my script in the files that PAR::Packer will convert ?

I'd also like to ask about your opinion to deploy my script, would you recommend another method to do so ?

Regards.

Update : I Corrected the case of PAR::Packer

Comment on Par::Packer, include conf files or not ?
Select or Download Code
Re: Par::Packer, include conf files or not ?
by marto (Chancellor) on Sep 24, 2012 at 09:16 UTC

    " I developped a Perl script on Red Hat Stawberry Perl"

    Strawberry Perl is for Microsoft Windows only.

    "(I know that this operation will hide the source code but that's also something I'm looking for...)"

    pp won't protect your source code. PAR::FAQ.

    "I'd like to deploy this script in various environnements (Windows, Red Hat, Open SUSE, ...) and to do so I did my research and discovered pp (PAR::Packer) that seems to answer my problems."

    Just so you're sure, you'll need to create an exe to cover each binary platform On what platforms can I run PAR? On what platforms will the resulting executable run? and more in PAR::FAQ.

    "I tried to install Par::Packer from CPAN on my developpment environnement, but the installation failed, so I'm having one major question about Par::Packer that I'd like to be answered"

    How did it fail? See How do I post a question effectively?.

    "Do I need to include that root-logger.conf in the files that Par::Packer will package (like I'd add a library) or will my module still be able to read it if I leave it "outside" the packaged file ?"

    pp see the -a option for adding files. Alternatively have them in a directory you control, however this seems unlikely given the number of environments you want to target.

    Update: fixed a couple of typos.

      Hi,

      First of all, thanks for your answer, then I appologize for the lack of information of my post or the (now obviously) absurdity that I've said.

      "pp won't protect your source code. PAR::FAQ."

      I did read this FAQ and I think I didn't express myself correctly, I do not intent to absolutely protect my code from everyone, I know it's simply impossible... What I intend to do is simply deliver a file.exe (on Windows) or a file.sh (on Unix), without the need to install all the modules and add all the libs. The file itself will not be a script.pl, but something a little bit less understandable and of a very simpler use...

      "Just so you're sure, you'll need to create an exe to cover each binary platform"

      Yes, that's basicaly what I intended to do, I would deliver the file "upon request" to the OS that have been specified

      "How did it fail?"

      Even if I know that fixing the installation issues I have will also answer my question, I didn't ask on my installation issues, I asked on the behavior of the module itself, so I didn't include a long log of my console when the installation failed (PAR::Packer has a lot a dependencies) to avoid unnecessary informations. If you think this information is necessary to answer me, I'll join it in the next answer

      "pp see the -a option for adding files."

      I already looked the CPAN presentation of pp (http://search.cpan.org/~rschupp/PAR-Packer-1.013/lib/pp.pm), but my question was intended for developpers which already used pp and knew if the packaged module was still able to read external files or if I had to include them.

      Regards.

        "Even if I know that fixing the installation issues I have will also answer my question, I didn't ask on my installation issues, I asked on the behavior of the module itself, so I didn't include a long log of my console when the installation failed (PAR::Packer has a lot a dependencies) to avoid unnecessary informations. If you think this information is necessary to answer me, I'll join it in the next answer"

        It's not required to answer your question, but if you can't install pp how to you expect to use it to develop and test your application in it's packaged form?

        "but my question was intended for developpers which already used pp and knew if the packaged module was still able to read external files or if I had to include them."

        I answered your question, of course a package generated by pp can read files external to it, since you're going to delopy to many servers which you may not have control over, do you think it's wise? Hence my pp -a suggestion. That said, had you a working pp installed you'd be able to test this for yourself.

Re: Par::Packer, include conf files or not ?
by Anonymous Monk on Sep 24, 2012 at 09:19 UTC
    You wrote "Par::Packer" several times but it is not a module on cpan, however there is a PAR::Packer -- case matters

      Thanks, corrected

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://995319]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2014-08-28 02:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (255 votes), past polls