in reply to Executing an application in Perl/CGI
Your call to system needs to have parentheses for the die to work (aside from the fact that system returns "false" on success).
system 'cmd.exe /c notepad.exe' || die 'no notepad'; # is the same as system( 'cmd.exe /c notepad.exe' || die 'no notepad' ); # but you want system( 'cmd.exe /c notepad.exe' ) && die 'no notepad'; # or you could do system 'cmd.exe /c notepad.exe' and die 'no notepad';
You could also get a little more explicit about what you expect from system:
0 == system 'cmd.exe /c notepad.exe' or die 'no notepad';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Executing an application in Perl/CGI
by Anonymous Monk on May 22, 2007 at 19:33 UTC | |
by blazar (Canon) on May 22, 2007 at 19:39 UTC | |
by Anonymous Monk on May 22, 2007 at 19:49 UTC |