in reply to Re: creating utility in perl
in thread creating utility in perl

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

Replies are listed 'Best First'.
Re^3: creating utility in perl
by davido (Cardinal) on Jul 04, 2013 at 06:23 UTC

    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.


    Dave

Re^3: creating utility in perl
by dasgar (Priest) on Jul 04, 2013 at 06:30 UTC

    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.

Re^3: creating utility in perl
by 2teez (Vicar) on Jul 04, 2013 at 06:31 UTC

    Check this NOTES it will answer your question and satisfy the longing of your heart..

    If you tell me, I'll forget.
    If you show me, I'll remember.
    if you involve me, I'll understand.
    --- Author unknown to me
      hey

      so i will give you the entire detail of what , how I have done , and the issue I am having .

      I have a script which uses Text::CSV cpan , I installed that cpan in my PC and its working fine . Now I wanted to make an exe file ,so I installed PAR::Packer and pp and created .exe successfully with this code  pp -o packed.exe source.pl

      so now when I run this executable on some other system which does not have this Text::CSV cpan it fails . I want that user without installing this cpan , and if possible even without installing perl be able to execute this exe file

      Is it possible for me to be able to do it

      FYI i also did pp -P -o packed.pl source.pl to make a packaged file , but when I execute it , an error saying "The application has failed to start because perl516.dll was not found " is shown

      wow long post , I have followed every step as you guys described installed PAR::Packer and pp . It is confirmed they are installed properly as cpan in strawberry says so . The a.exe is created in PAR::Packer , but it does not run , if I click on it , it opens momentarily dies and via command prompt too the same thing is happening . I can't understand the reason why ? And with me there is no proxy issue
      so I just have to type these commands before my script to do so , if not then how to do it ??
      % pp -o packed.exe source.pl $ packed.exe

      sorry for asking so basic questions , first time user

        Just like the documentation said.

        # makes packed.exe % pp -o packed.exe source.pl # Now, deploy 'packed.exe' to target machine... # on the target machine now do this.... $ packed.exe
        YES!!!
        what are you afraid of. Worse it won't run, is that not so? Atleast it wouldn't transport you to MARS!!! :)

        If you tell me, I'll forget.
        If you show me, I'll remember.
        if you involve me, I'll understand.
        --- Author unknown to me

        What happened when you tried this? Seriously, it would have been quicker for you to do this yourself rather than ask people what will happen.