in reply to Re: perl standalone to run perl script as a parameter
in thread perl standalone to run perl script as a parameter
I am using a tool (IBM TEM) that can launch different types of processes on remote PCs. For example, I can tell it to run "perl myscript.pl" or "dir *.err" in a specific folder on a PC and use the processes to collect inventory data from that PC.
I cannot (by policy) install Perl on these PCs. I can however, have a standalone perl.exe on them to use at my discretion.
I am currently using a simple perl.exe (standalone) in a folder with some other tools. I did not make this exe, it was compiled by someone else (no longer here). I am calling this perl.exe remotely to run a configuration script written in Perl. The configuration script runs some system commands and parses the returned data. All that works.
My example: "perl invconfig.pl"
My dilema:
1. I need to change the abilities of the standalone perl.exe. I need a standalone perl.exe which has a few specific modules compiled with it AND probably have it be able to accept the configuration script as the parameter. For example, I want to add the Win32::TieRegistry module.
2. I "could" compile the configuration script, along with the necessary modules and any command changes each time I need to update the invconfig.pl. In that case I would just run the invconfig as a standalone exe. I would like to avoid that and leave the perl.exe unchanged and only changing the invconfig.pl, as needed. The configuration script gets updated regularly, adding and/or removing commands as needed. Because of this I don't want to have to recompile it each time. I also would like others to be able to do simple modifications to the invconfig.pl without having to recompile it.
So, ultimately I am trying to have a custom perl.exe that will only get rare updates (as needed), that will run a perl script and provide any required modules to it.
I don't completely understand what has to be in the custom perl.pl when I do Perl2Exe on it, so that it is able to run the configuration script.
My examples in my original question show what I was attempting to do, but they do not work.
If I compile it with this line, which I would guess should always run the same configuration script: $ret = `perl invconfig.pl`; when I try to run the custom perl.exe like this "customperl.exe", perl says it can't find perl (or similar error).
If I try to compile it with one of these lines, presumably to locate the custom perl to execute the passed in script name:
I get a warning that perl is not found in the path during compile time.$ret = `$^X $ARGV[0]`; or system('$^X $ARGV[0]');
I'm trying to use a standalone perl to call itself and run a script. I can limit the placement to a single folder if necessary. Perhaps, I am approaching this whole thing incorrectly. I just don't know.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: perl standalone to run perl script as a parameter
by dasgar (Priest) on Jul 17, 2012 at 02:36 UTC | |
by eammendola (Initiate) on Jul 18, 2012 at 04:35 UTC | |
|
Re^3: perl standalone to run perl script as a parameter
by CountZero (Bishop) on Jul 17, 2012 at 15:11 UTC | |
|
Re^3: perl standalone to run perl script as a parameter
by Anonymous Monk on Jul 17, 2012 at 02:34 UTC |