......if(defined($filelist)){ $cmd = "$odhome\\bin\\iwodstart $iwodclient_cfg -k srcArea=$so +urcePath -k targetArea=$targetPath -k definition=$deploymentDefinitio +n -k workareaName=$workareaName -k filelist=$filelist -inst $$ 2>&1"; }elsif(defined($workareaName)){ $cmd = "$odhome\\bin\\iwodstart $iwodclient_cfg -k srcArea=$so +urcePath -k targetArea=$targetPath -k definition=$deploymentDefinitio +n -k workareaName=$workareaName -inst $$ 2>&1"; }else{ $cmd = "$odhome\\bin\\iwodstart $iwodclient_cfg -k srcArea=$so +urcePath -k targetArea=$targetPath -k definition=$deploymentDefinitio +n -inst $$ 2>&1"; } @output = `$cmd`; print "CMD = $cmd <br>"; #Check for the success/failure of the deployment process. $rc = $?; my $success_flag = 0; foreach (@output) { $success_flag = 1 if (/ERROR/i); $success_flag = 1 if (/Status: Failed/i); } ...


In this code, isn't $? supposed to be mentioned in $cmd ? If its not mentioned there, will it still obtain error value from the execution of $cmd at command line ? Will this $cmd return any value if deployment is successful or not ?
If there is another execution on cmd line in the code, what error value will be represented by $? ?

Thanks

In reply to Understanding $? by manishrathi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.