Dear monks,
I'm writing a Perl pipeline which consists of a script executing other scripts (Perl and non-Perl). My question:
Say I have scriptA.
ScriptA executed well and returns valueX that will act as input of scriptB.
But suppose, there was a problem in the execution of scriptA and it did not return valueX, what would be the best way (command) to make my pipeline die?
I tried:
system($scriptA);
#? == -1 ? die "Command failed: $!\n" : print "Command executed succes
+sfuly\n";
This line works fine if I called a command that does not exists (script will die), but I believe that proceeding this way do not make the script die if the command is found and called but not executed because of wrong/absent arguments...?
Thanks,
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|