http://www.perlmonks.org?node_id=1053689


in reply to Interpret $? variable

It depends on the command.

Have a look at this. I hope it's helpful.