Hey BrowserUK, thanks again for the reply!
Humm.... I was going to do your example but your first line confused me a bit... Sorry, I'm not brand new to
Perl or anything like that but I'm definitely no expert.
But since my script uses Gtk2, I can't really use the "Sleep" command in the final 'production' script, since
the regular 'sleep' command will pause the processing of Gtk events.
But for pure testing purposes only I tried this and it seemed to work:
my $pid = system 1, ".\\bg_script.pl $ARG1 \"$ARG2\" $ARG3 $ARG4";
print "\$pid == '$pid'\n";
while (kill 0, $pid)
{
print kill 0, $pid;
print "\n";
sleep 1;
}
print "\n\nOUT OF WHILE LOOP\n\n";
______________OUTPUT______________
C:\Script_dir>main_script.pl
$pid == '3144'
1
1
1
1
1
1
0
OUT OF WHILE LOOP
Nice, so it looks like its working that way.... Weird, do you think I had a typo the first time I posted
that, or do you think I can't set it to a variable and check it that way?
And just so you know, in my final script that was working before, with Proc::Background, which was before
I attempted using the CavaPackager to turn this into a standalone executable. I was using a while loop and the
usleep command from --> "use Time::HiRes qw( usleep );" which sleeps so quickly that I was able to continue
processing Gtk commands during each loop. I can show the code for that if your interested...
But anyway, in terms of the Win32::Process, when reading the cpan page for Proc::Background, it sounded like
that Proc::Background Module when run on Win32 it automatically uses the Win32::Process Module.
Is that right, or to try that Win32::Process, do I need to specifically call that, because it looks
like there is quite a good bit of a difference between the two?
Thanks Again,
Matt
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.