How do you you check the return code of a command in Perl

Suppose you run a program/script in Perl:

system("./server ....");

How will you check the return code?

Questions by mpathak   answers by mpathak

Showing Answers 1 - 12 of 12 Answers

perl_guy

  • Dec 6th, 2007
 

system calls *traditionally* returns 0 when successful and 1 when it fails.

system ( cmd ) && die "Error - could run cmdn";

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions