Hi, all monks:
There are two ways to launch system commands in perl, one is by the system operator, and the other is by the backquotes operator.
The system operator can only get the exit status of the command, and the backquotes operator can only get the output of the command.
Sometimes I want to get both the exit status and the output of the command, so I can process the output base on the exit status. Usually I do it by this way: first, launch the command by the system operator to get the exit status, then launch the command again by backquotes operator to get the ouput. But this solution is not that good when launching some network commands, because the network status can be changed between the execution of the two commands.
So, my question is: Is there any way I can get both the exit status and the output of the command without launching it twice?