prescott2006 has asked for the wisdom of the Perl Monks concerning the following question:

As title, is it possible to compile a portable Perl program on Windows to run on UNIX with all necessary module? The UNIX only has Perl core module installed and no additional new module is allowed.
  • Comment on Compile portable Perl program on Windows to run on UNIX

Replies are listed 'Best First'.
Re: Compile portable Perl program on Windows to run on UNIX
by DrHyde (Prior) on Apr 10, 2012 at 09:48 UTC
    If no additional new modules are allowed, then you're stuffed. However, what you probably meant is that you can't get any modules installed *in the default location*, in which case the solution is obvious. Install them somewhere in your home directory and set PERL5LIB appropriately.
      But I have no privilege to use internet on that server, am I able to install new module? Can you show me how to install module in a specific location? I follow tutorial on web but no luck.

        Did you actually read this post and the link provided before replying? If so what problems do you have, is there anything you don't understand? Unless you tell people what you are having problems with, repeated requests for help aren't going to do much good.

        There are links to eleventy million pages explaining how to install modules in your home dir here. Of them all, these days I recommend using local::lib. At least, I do on Unix. No idea how well it works on Windows.

        To install without internet access you'll need to get the distribution (the Some-Module-1.234.tar.gz) file or its contents onto the machine. Untar it, then ...

        cd Some-Module-1.234 cpan .

        Adjust as necessary for other CPAN clients. These days cpanminus is probably the best choice.

        Installing dependencies can be a gigantic pain in the arse if you don't have internet access (or you don't have a copy of the CPAN already on the target machine). If you have lots of dependencies, then I suggest that you build another machine similar to the target - same OS, same word length - which could be a virtual machine on your desktop which *does* have internet access, and build all your modules there. Once that's done, copy the results to the target machine and hope for the best.

Re: Compile portable Perl program on Windows to run on UNIX
by Anonymous Monk on Apr 10, 2012 at 06:28 UTC

    Theoretically yes, but its too much work

    Sure, fireup a UNIX virtal machine , do the compiling, then send to the real UNIX machine

    cross your fingers :) Urlader - installer-less single-file independent executables