michbach has asked for the wisdom of the Perl Monks concerning the following question:
Programm B.pl should start Programm A and then always proof what A.pl is writing to stdout and then do anything .... Many thanks and best regards, michbach PS: i use Windows-XP#XXXXXXXXXXXXXXXXX Code von A.pl XXXXXXXXXXXXXXXXX use Time::HiRes qw(sleep); $out = 1; while(1==1) { #### delay #sleep 1; dont work sleep 0.001; #### write to output to stdout print "\n$out"; $out++; #### start on 0 again if($out > 50){$out = 1;} } #XXXXXXXXXXXXXXXXX Code von B.pl XXXXXXXXXXXXXXXXX open(FH, "c:\\A.pl |") or die "Open-Fehler...\n"; while($tmp=<FH>) { chomp($tmp); #### proof the output from A.pl if($tmp eq 25){print "\nTreffer";} print "\n$tmp"; } close (FH);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: use the return code of another program
by ikegami (Patriarch) on Mar 28, 2009 at 01:08 UTC | |
by michbach (Sexton) on Mar 28, 2009 at 10:46 UTC | |
|
Re: use the return code of another program
by sflitman (Hermit) on Mar 28, 2009 at 05:00 UTC |