Re: creating utility in perl
by dasgar (Priest) on Jul 04, 2013 at 05:54 UTC
|
My suggestion would be to install PAR::Packer from CPAN and use the pp utility (from the PAR::Packer module) to create a stand-alone executable.
(NOTE: The PAR::Packer module needs to be compiled, which means that you need a compiler and compiler tools to do this with. If you're on a *nix like OS, you might already have those installed.)
| [reply] |
|
|
hey if I use PAR::Packer , then the user will have to install cpan in his system as well . I want to create like we use utilities , no need of installing anything , just execute and give the inputs .
So what if I have cpans in my program as well , I just need to know two things
1) Do every user using this standalone , will have to install this PAR::Packer , or just the creator
2) What if in the script some CPan is used , after PAR::Packer ,do every user will have to install that CPAN also
the thing is I wish to make it user friendly , so i need to abstract all these things from user
| [reply] |
|
|
hey if I use PAR::Packer , then the user will ahve to install cpan in his system as well.
Did you even read the documentation? (Nevermind, we already know the answer to that question.)
This is exactly what PAR::Packer, and the pp utility are designed to avoid. The point is that using a solution such as PAR::Packer you can distribute a standalone application.
| [reply] |
|
|
The pp utility in PAR::Packer will bundle your code, the modules needed by your code and the Perl interpreter into a stand-alone executable. That means the executable contains everything needed to run the script. For example, let's say that you've got two systems that have the same OS, but Perl is only installed on system A. So you create a Perl script on system A and use pp to create an executable. You can now take that executable to system B and it will be able run the executable just fine. System B could have no Perl installed, different version of Perl installed, missing required modules, etc. and none of that matters because it is using the contents of the executable.
There are some caveats and exceptions to what I described above, but what I described is accurate. Try installing PAR::Packer and read up on the documentation of the pp utility. It will do exactly what you're wanting to do.
| [reply] |
|
|
| [reply] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|