Fair enough. I may be asking the question incorrectly. I'll back up a bit and explain why I am trying to do what I am trying to do. And I really appreciate your guy's patience.

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:

$ret = `$^X $ARGV[0]`; or system('$^X $ARGV[0]');
I get a warning that perl is not found in the path during compile time.

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.


In reply to Re^2: perl standalone to run perl script as a parameter by eammendola
in thread perl standalone to run perl script as a parameter by eammendola

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.