The module has a bunch of other mundane stuff that is not directly relevant to this coolness. Nevertheless, the MyScriptUtils::RunTempScript function is *very* simple

It simply: 1) takes the input string (FooScript code); 2) saves it to a temp file (eg "c:\temp.foos") and; 3) runs the temp file we just created by using the perl 'system' command.

system "$sBinPath $sTempFile";

The code is pretty trivial, also, people have their own preferences regarding how to make a temp file, whether or not to use the 'system' command (eg for security reasons) and other side issues that are useful to bring up, but secondary to the original intent to just get the main idea out in the open.

It should be added that this is not a preferred method, but a klunky workaround if your scripting environment doesn't support OLE, CORBA, XMLRPC, or other Perl-compatible interop facility for getting stuff into and out.


In reply to Re^2: Fill in the missing features from your other script language by dimar
in thread Fill in the missing features from your other script language by dimar

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.