in reply to Re^3: native exit codes 512 and 2304
in thread native exit codes 512 and 2304

Although the exit code part of $? can be. That's what die prefers to use, for example. You can check what the exit code could mean as an error number, but be warned that it might not be accurate.

Keep in mind that even if $! is used as the exit code, it might not indicate the cause of the error.