Newbie: How do I filter output to the screen and writing the orginal output to a file?

M

Mav

Thanks again.
I probably don't use die to since I need to get the Failed
....
close BUILDLOG;
close $proc;
#Check Build Result
if ($? == 0) {
$buildResult = "Passed";
}
else {
$buildResult = "Failed";
}

Do you think that is a better way?
 
G

Gunnar Hjalmarsson

Mav said:
I probably don't use die to since I need to get the Failed
...
close BUILDLOG;
close $proc;
#Check Build Result
if ($? == 0) {
$buildResult = "Passed";
}
else {
$buildResult = "Failed";
}

Do you think that is a better way?

If you think it is, I have no reason to object. :)

A closer equivalent to

$buildResult = system(@args);

would be to just do:

close $proc;
$buildResult = $?;

What makes most sense probably depends on how you want to use
$buildResult.
 
M

Mav

Cool, I think second will be better instead of just die.
'coz I don't want to kill the script that is calling.

Thanks a lot, Gunnar.
You answers are very helpful,

Mav
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top