in reply to Re: System() question
in thread System() question

Cool, I appreciate everybodies help. I tried running the fork method first and got it working and then tried system("....&"). Both worked wonderfully. I had to add the following code to look for when the output log was written and look for a tag that shows when it is done being written too. I'm worried thought that this may not be the most efficient way of accomplishing this. Will the continual checking take up too much processing time? Thanks

while (open (OUTPUT, "$path/output.txt") == 0) {

if ($cnt == 0) {
print "Waiting for Output.log from Program\n\n";
}
$cnt++;
}

my($lastline) = 0;
until ($lastline =~ m/END_OF_FILE/) {
open (OUTPUT, "$path/output.txt") or die "Can't
open output log: $!\n";

while (<OUTPUT>) {
$lastline = $_;
}
close OUTPUT;
unless ("$lastline" =~ "$prevline") {
print $lastline;
}
$prevline = $lastline;
}

Replies are listed 'Best First'.
Re^3: System() question
by sgifford (Prior) on Jun 14, 2006 at 03:42 UTC