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