in reply to Re: qx and $!
in thread qx and $!

Some operations set $! to 0 on success (but don't count on it!). "Bad file descriptor" is error 0 on some systems.
$! = 0; print("$!\n"); # Bad file descriptor, or Illegal seek, or ...