http://qs321.pair.com?node_id=322924


in reply to How to Trap exit code from system calls

If you read perldoc -f open carefully:

Closing any piped filehandle causes the parent process to wait for the child to finish, and returns the status value in $?.