in reply to Is "die" the best way to be atomic?

A bug on your behalf: system behaves opposite to most other built-in functions, in that it returns false on success. So system($foo) or die is a mistake. You can use
system($foo) and die "system() failed, error code " . ($? >> 8);
But actually the return value of system is more complex than this. You might want to check perlfunc -f system. The return value -1 in particular is quite revealing.