in reply to passing string/refs to run_on_finish with Parallel::ForkManager

Registers are used primarily to hold addresses rather than data (which is more often kept in RAM), but exit codes are a special case because when a program has exited, it has cleared out of its addressing space (update: or at least is deemed to have done so by convention at a low level of operating system design) leaving only the conventional register to communicate with the shell.

Thus exit codes irrespective of what language the program might be written in are limited by operating system conventions to what can fit into a register - usually max 64 bits these days although the exact implementation is likely to have its roots in the first implementation of Unix on a 16 bit machine. At that point in time (early 1970s) the machine was the PDP-11. Its registers were numbered R0 to R11 and the exit code of any program was placed in R0, a sixteen bit register to be picked up after exit by the shell.

__________________________________________________________________________________

^M Free your mind!

  • Comment on Re: passing string/refs to run_on_finish with Parallel::ForkManager