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

Hi Monks, I created a Perl script & I want to let it execute on every machine. But the problem is I need to install the perl compiler on every m/c.Do any one has solution?
Pl. let me know
Thanks
  • Comment on How to run scripts without perl interpreter

Replies are listed 'Best First'.
Re: How to run scripts without perl interpreter
by Corion (Patriarch) on Feb 16, 2004 at 10:21 UTC

    PAR can help you to create a standalone executable that you then can run on every machine, as can http://tinyperl.sf.net by gmpassos.

    The better way would be to make Perl available on every machine, either through a network share or locally, so that your future scripts run without intervention by your side.

    If you use Win32, installation of Perl can be automated through user logon scripts if you have a setup of one user per machine, or via the process API, where you can launch tasks (like the installation) remotely.

    On Unix, automation via ssh and passwordless logins/ssh-agent would be the most elegant way to push Perl initially on all machines I think, but other people here might have more experience with keeping a number of machines in sync. When you're on Unix though do not replace the system Perl with your Perl, as system tools might rely on the specific version of Perl installed!

    Edited: Changed tinyperl link from broken to sf.net. Thanks to DaWolf

Re: How to run scripts without perl interpreter
by edan (Curate) on Feb 16, 2004 at 10:19 UTC

    Look at PAR, and specifically pp

    --
    edan (formerly known as 3dan)

      Hello everybody,
      Many thanks to all of you!!
      PAR solved my problem! I installed PAR & used pp to make an executable file.
      Thank you very much for your guidence!
Re: How to run scripts without perl interpreter
by tilly (Archbishop) on Feb 16, 2004 at 16:04 UTC
    An alternate approach if it needs to run on every machine on a network, but you don't want to install to each one is to install to the network and run Perl off of the network install. (You can also add any modules that you want to the network install, and they will be available to everyone.)

    For a Windows network all that you have to do is install to a network drive. Then take a Perl script and run pl2bat. That creates a .bat file that will work if Perl is in the path. Go in and edit the .bat file so that its invocation of the Perl interpreter is a fully-qualified path to the location of Perl on the network. (eg \\host\and\the\path\to\Perl\bin\perl.exe)

    Those .bat files will now work on any Windows machine on the network, and will be a lot smaller and easier to edit than the other offered solutions.

      If you do this, watch your permissions. Our work setup (not set up by myself) allows any user in the company to install modules through CPAN or ppm. Ok, I consider this a feature (and exploit it often -- though I'm allowed to), but it is a definite sign of a permissions problem -- users could use perl to destroy perl, so to speak...not good. We also use pl2bat -- good stuff!
Re: How to run scripts without perl interpreter
by fenn (Initiate) on Feb 16, 2004 at 15:02 UTC
    I've used Perl2exe in a MSWindows commercial environment and found it useful and inexpensive; it is available for other platforms as well. http://www.indigostar.com/perl2exe.htm
      FYI -- PAR works great on Win32 and is free. You can download it via ppm, but it's an old version that does not have the "--gui" option to disable the console for GUI apps (such as Tk). To get the "--gui" option, you will need to use the version of PAR in CPAN, which will probably (if I recall correctly) require MSVC++ to comile the module. I'd look at PAR before paying for something.
      Hi,
      Perl2exe works fine on MSWindows English platform,but you will get improper behavior on German platform. But any way PAR & pp are the most beautiful things and works on Multilingual (Win2k English/German) platform.
      Thanks