in reply to Return code from calling qx

The docs clearly answers your question. $? is

The status returned by the last pipe close, backtick (``) command, successful call to wait() or waitpid(), or from the system() operator. This is just the 16-bit status word returned by the traditional Unix wait() system call (or else is made up to look like it). Thus, the exit value of the subprocess is really ($? >> 8), and $? & 127 gives which signal, if any, the process died from, and $? & 128 reports whether there was a core dump. (Mnemonic: similar to sh and ksh.)

Replies are listed 'Best First'.
Re^2: Return code from calling qx
by Argel (Prior) on Oct 28, 2009 at 00:16 UTC
    The docs may explain it, but trying Googling for qq{perl "$? >> 8"} sometime. Google doesn't even honor the phrase so the results are not that impressive. On Google it's hard if not impossible to search for "$? >> 8? -- try it without "perl" and you will get links to the number 8 because Google is not searching on the phrase even though it is in quotes (probably too many special characters). One more reason not to like the five bazillion special two character variables Perl has (of course, when typing them in, most of us really like them! :-)

    Elda Taluta; Sarks Sark; Ark Arks

      I fail to see your point, especially since "special perl variables" turns up the very text I quoted in the first result.
        Yes, but the OP was interested in what the ">>" line did, so he likely searched for something like "$? >> 8" -- and the results for that are not nearly as useful because Google doesn't treat that as a phrase. So while the docs do indeed clearly answer the question, the most obvious search at first glance will not take you to the docs. In other words, "The docs answers your question" would have sufficed -- no nead to use "clearly" and the negative connotations that it implies.

        Elda Taluta; Sarks Sark; Ark Arks

        I see it as more of a complaint about Google's handling of special character searches. Such has annoyed me on many occasions too... I know exactly what I want to search for, but can't do a search on it to find the alternate ways to ask for it.

        ... if only Google had a perly regex mode...