in reply to Re: Executing an application in Perl/CGI
in thread Executing an application in Perl/CGI
system 'some_command' && die 'cannot execute some_command';
Really, both this and the OP's attempt get it wrong due to precedency issues. In fact I find myself repeating once again that as a rule of thumb, high precedence logical operators are for values and low precedence ones are for flow control. In particular, the OP's code appears to work because the die is never actually reached, while yours is the same as
system(die('cannot execute some_command'));
So the program dies before calling system.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Executing an application in Perl/CGI
by Anonymous Monk on May 22, 2007 at 19:38 UTC | |
by blazar (Canon) on May 22, 2007 at 19:42 UTC |