jeffw_00 has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: wperl.exe briefly creates a CMD window (Win32::SetChildShowWindow)
by Anonymous Monk on Aug 11, 2019 at 19:05 UTC | |
|
Re: wperl.exe briefly creates a CMD window
by jcb (Parson) on Aug 12, 2019 at 03:17 UTC | |
|
Re: wperl.exe briefly creates a CMD window
by jeffw_00 (Novice) on Aug 11, 2019 at 19:59 UTC |