in reply to Re: How to know the status of a command invoked by open function?
in thread How to know the status of a command invoked by open function?

No. $? is only meaningful if the system call succeeds in this case, and it's always meaningful after wait, waitpid, system and backticks.

Replies are listed 'Best First'.
Re^3: How to know the status of a command invoked by open function?
by zhujian0805 (Sexton) on Aug 16, 2011 at 00:51 UTC
    See this from Perl.The.Complete.Reference.2nd.Edition.2001
    
    The close function, on the other hand, picks up any errors generated by
    the executed process because it monitors the return value received from the child
    process via wait (see the “Creating Child Processes” section, later in this chapter).
      Yes, I'm well aware of how it works.
Re^3: How to know the status of a command invoked by open function?
by zhujian0805 (Sexton) on Aug 16, 2011 at 00:51 UTC
    I know what the meaning of $?. but for my case. I used open to run an external program
    

      Yes, but the Anonymous Monk to which I replied didn't.

      He's right that close PS; should be close PS or die $!;, but it won't change the result.

      Note that by "system command", he meant "system calls", not the system builtin.