Hi - I am using Windows 10 (latest), and Strawberry Perl (also latest). I have a perl script that is a "watchdog". It checks that a file has been updated recently (by another program), and takes action if it hasn't. If there are no exceptions, the code it runs every 15 min is below. I started this script using

psexec -d  c:\strawberry/perl/bin/wperl.exe c:\<scriptlocation>\<myscript.pl

The annoyance is that whenever it runs, a CMD window appears very briefly, and I have no idea why. I thought wperl couldn't do that.

Note: I recently switched from Activeperl (latest), because the ActivePerl libraries needed for get("webpage") were out of date (and I use this function in a different script). Point is, this annoyance did -not- happen with ActivePerl.

I can find little on the web specifically about "wperl" and that's why I'm posting - Thanks in advance for any help you can provide. /j

PS - I have a few background perl scripts running. They were dead stable in W7, but they seem to occasionally crash for not reason in W10. I understand it could be my bad coding and am working on debug, but I'm wondering if I should convert them to services (using NSSM) for stability and also for better error logging. Or would I just be taking on a whole bunch of new hurt? Thanks!!!

while(1) { # timestamp the check $ffail=0; open (HC,"> $heartcheckfile") or $ffail=1; if ($ffail == 0) { print HC "$mypid\n"; close (HC); } # check for heartbeat $res = check_filemod($margin+$interval,1,$heartfile); if ($res == 0) { # PH healthy sleep ($interval*60); # otherwise, nothing to do but wait for ne +xt check } # exception if $res !=0 omiitted as not executed @lines = `tasklist /FI \"IMAGENAME eq wperl.exe\"`; my $found=0; foreach $line (@lines) { @words = split " ",$line; if (($#words > 0) && ($words[0] =~ "wperl") && ($words[1] ne $my +pid)) { $found=1; } } # exception if found=0 omitted as not typically executed }

2019-08-12 Athanasius added code tags.


In reply to wperl.exe briefly creates a CMD window by jeffw_00

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.