CavaPackager is a program that has a GUI you can use to 'build' perl scripts into standalone executables.
I plan on putting this program on a few different PCs around the office and don't want to have to install
Perl, as well as ALL the required Modules, espically Gtk2/Pango/Cairo/etc on each and every PC I want this on...
Which is rather time consuming.
Here is my ORIGINAL Code Snippet which executes the Background Script:
       
*This is only a small snippet to get the idea...
       
*FYI, the Background script opens a TCP Socket and sends some data to a server.
my $TIMEOUT = 30;
my $proc;
my $bg_script = "./bg_script.pl";
$proc = Proc::Background->new("perl $bg_script $ARG1 \"$ARG2\" $ARG3 $
+ARG4");
my $PID = $proc->pid;
my $start_time = $proc->start_time;
my $alive = $proc->alive;
my $timeout_start = time;
my $timeout_current;
my $timeout_diff;
while($alive ne 0)
{
$alive = $proc->alive;
# This will continue the processing of Gtk Events...
while (Gtk2->events_pending) {
Gtk2->main_iteration;
}
Gtk2::Gdk->flush;
$timeout_current = time;
$timeout_diff = $timeout_current - $timeout_start;
if ($timeout_diff >= $TIMEOUT) {
last; #->Use 'last' to break out of loop if we
+timed-out...
}
# Sleep for 1000 milliseconds
usleep(1000);
}
I'm not exactly sure how it works, this is my first time using the CavaPackager Program, but after it's
done it will be a ".exe" and not a ".pl" so not sure if leaving the "perl" before the script will work in
the end...
But back to the Win32::Process, does anyone think this would be better to use then using the system command
that I said I got working in my last post?
I was just kinda curious if there were any Pros and/or Cons between using that system call method I got
working, and the "Win32::Process" method
(*I guess only if it differs from Proc::Background)...
But anyway, I'm heading home shortly, I think I just need to step away from this for a bit and take a breath.
My head is sort of spinning with all this stuff.
Thanks AGAIN to everyone who posted, much appreciated!!
Thanks,
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.