in reply to stop process based on exit status.
I don't think you can get an exit status from a pipe. If you're on *n*x you could tryuse strict; use warnings;
andopen(FILE,'run_tool -f "test.tcl" 2>&1; echo Status code: $?|');
I'm not sure how to do the equivalent in Windows.exit 1 if ($_ =~ /^Status code: [^0]/)
Another option is to use -f (see man perlfunc) to test whether the file exists before you run the command.
|
|---|