in reply to trying to understand references

This has less to do with references than with processes. fork creates a new process with its own memory space, which is not shared between child and parent. The memory map that each process sees is the same (because the fork is an identical copy), but that's just the memory map of the process and it's not the same as the OSes virtual (or the machines physical) memory. You can use threads if you want to use shared memory, or explicitly set up a shared memory space (for example with IPC::ShareLite) for forked processes.


Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian W. Kernighan