in reply to trying to understand references

Welcome to the world of paged virtual memory, where every process has its own memory space.

It is virtual, because memory address 0x814db78 in process A is different from memory address 0x814db78 in process B.

Where 0x814db78 is actually located in memory can change at any time. It could even be swapped out to disk. Paging allows this.

Therefore, just because Perl prints 0x814db78 for both variables doesn't mean it's the same variable.

 

It is possible to share memory between processes on some platforms. I believe there is a module to do just that in the IPC hierarchy.

Update: IPC::Shareable looks promising.