Whilst not pretty, it is pretty simple and clear.
I beg to disagree. I recently implemented new features that needed to exit, but I had to literally experiment with all the possible combinations of exit statuses and AndExits to find the values leading to the expected behaviour. There's no documentation and only the comments shown. I'd think that "and exit" means "exit", not "and exit if not called from the command line and the number of errors is greater than some arbitrary constant plus a global variable whose value changes in 10 more places, good luck".
Otherwise, you're right. The global state is enormously large and contains lots of magical hashrefs as the one shown in Can you use string as a HASH ref while "strict refs" in use?. Also, many subroutines start with a boilerplate of
You know, just in case you needed a variable, but couldn't declare one. One or two of them are actually used sometimes, but you never know which ones.