And old question, I know, and one with a lot of possible answers. But even after searching the archives and reading past discussions, I still need a little guidance.

I have over recent years written a number of small Perl utilities that get called from a massive (commercial) Windows program to accomplish various functions. When called, they of course open a DOS window, do their thing, and close it, usually only a couple of seconds at a time.

This was never a problem, but now suddenly it has become an issue. I tried simply changing the windows associations to call wperl.exe instead of Perl.exe.

That worked beautifully.

Well, almost.

It seems many of these little programs have a line of the form:

open(EP,"$DOSProg arguments|");

Some logic here interprets the data returned by DOSProg.

This runs a MSDOS program that does it's thing and returns data to my Perl script. When running under Wperl, the DOS window still pops up when this DOS app is called. This DOS program is a special purpose utility that would be difficult to re-create purely in Perl.

I am trying to figure out an elegant way to hide this secondary DOS window without requiring massive changes to all the places these scripts are called, etc. I want to find a low-work, low-risk solution to hiding the secondary DOS window.

I originally thought that since the wperl interpreter is running the Perl script in a hidden process, that any process it starts would be likewise. But I guess it isn't so. A shame as simply changing associations makes for an easily reversible hack for troubleshooting purposes.

Any suggestions?

Thanks,

Nat


In reply to Hiding the DOS window.. by wa4otj

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.