Thanks for the lead. For the sub{} share stuff, I am still not sure it's necessity. But consider the following code,
If I give anything try to alter the cloned structure, it give the Thread 2 terminated abnormally: Invalid value for shared scalar error.

This kind of assessment ( shareable R/W stuct ) would be more prior for my needs.

And for my ultimate purpose, I wish to share a struct which carrying different on-the-fly created objects, and they can cross access each other. Of cause I can change the style to share an array to indicate a "queue" and then every objects go inside the queue to look for action. However, this leads me to think, is if there's any transparent way for a complex stuct become shareable

This kind of assessment ( shareable R/W stuct ) would be more prior for my needs.

Sorry, but I'm having trouble understanding the meaning of that sentence?

And for my ultimate purpose, I wish to share a struct which carrying different on-the-fly created objects, and they can cross access each other.... However, this leads me to think, is if there's any transparent way for a complex stuct become shareable

Covering the last sentence first: As demonstrated; it is perfectly possible to shared complex data structures; and to modify them on the fly. But you do have to learn and follow the rules:

Everything except scalars stored as values in shared arrays and hashes, -- ie. any references to nested structures -- must themselves be shared:

Of cause I can change the style to share an array to indicate a "queue" and then every objects go inside the queue to look for action.

Shared data structures often seem like a good solution. The problem with them is how does one thread know when one of the other threads has modified something that it needs to look at?

The typical naive (Java-esque) approach to this problem is some elaborate setup using condition variables and locking and signaling and waiting; ie. synchronisation.

The problem with that is that it difficult to get right; prone to deadlocks, livelocks and priority inversions; and even when it is programmed correctly, it is usually ponderous because each communication of state -- condition signaling -- requires at least 3 context switches to occur. And with sod's law and competing threads and processes vying for processor time, often many more.

NB: these problem with synchronisation are not particular to Perl's shared state implementation; but also every other shared state mechanism; Indeed, they are far less prevalent with Perl due to its pretty unique explicitly-shared-only mechanisms; but still prevalent enough to avoid unless there is no alternative. (I've yet to see an application where there wasn't a better (usually queued) solution!)

Conversely, communications via queues is easy to reason about and get right first time; is not subject to any of the shared-state nasties above; and is efficient and effective because the right thread gets woken automatically when there is something for it to do; and lies dormant consuming no processor time when then isn't.

Finally, the problem with your application description is that you've decided that you should used shared structures and have defined it in those terms. If you would describe what you actually need to do; rather than how you think you should do it; it would be possible to suggest more effective alternatives; perhaps even point to existing similar examples or generate a small demonstration.

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.

"Science is about questioning the status quo. Questioning authority".

In the absence of evidence, opinion is indistinguishable from prejudice.

My real project is hard to explain, as the project scope is still defining, but from what I can understand, the structure is sound like a "online ARPG game".
So, there's a World Map, and there's monsters, and players.

So, whenever a player is connected, a new thread created, while everyone will access the same world map. When players walk, they may able to see monster or other players. and their coords changed, which should able to reflect to other players. And by certain time, killed monsters will reborn.

This is almost the case I am likely to face. Indeed, this is more safe in the "queue" approach, but on the other side, I believe I will create more bugs while coding as the full picture is harder to retrieve.

However one situation is true here which is fuzzy condition acceptable. Glitch from time race is acceptable in a certain amount of range.

So, whenever a player is connected, a new thread created, while everyone will access the same world map.

Hm. If you have any ambition that your game will support more than a few tens of concurrent players, then I agree with anonymonk, 1 thread per player is the wrong way to go. Imagine your game became moderately popular and you have 1000 players on line at a time. 1000 threads all sitting there consuming memory doing essentially nothing waiting for their user to type something. You'd need a machine with huge memory; but the processing could be done by a 386 class cpu and it would still be mostly idle.Now think about how you would scale that to 10,000 players. You'd need 10 times as much memory but still not much more cpu.

Equally, using an in-memory database would be very dangerous. One errant piece of code or a faulty power supply and bang! your game -- ie. your database -- is gone.

If you are serious about developing this, you need to seriously reconsider your architecture. Your game will need to reside in the database, and the database will need to be resilient and scale. You will need (to allow for) multiple comms servers talking to your player clients; and redundant, resilient, actively distributed database server back ends (or a cluster of machines accessing a distributed filesystem like hadoop).

Even if you want to start small on a single machine, you should separate the comms components and database components of the game and run them as separate processes on that machine and have them communicate through the database/distributed filesystem ONLY. Thus, when and if you need more capacity, you can separate the comms onto a different machine from the DB/game handling. And then if things grow larger, you can increase the number of comms servers and DB servers independently of each other to match your growing requirements.

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.

"Science is about questioning the status quo. Questioning authority".

In the absence of evidence, opinion is indistinguishable from prejudice.

Ada Lovelace for the palindrome
Albert Einstein for having smelly feet
Alfred Nobel for his contribution to battlefield science
Burkhard Heim for providing the missing link between science and mysticism
Claude Shannnon for riding a unicycle at night at MIT
Donald Knuth for being such a great organist
Edward Teller for being the template for Dr. Strangelove
Edwin Hubble for pretending to be a pipe-smoking English gentleman
Erwin Schrödinger for cruelty to cats
Hedy Lamarr for weaponizing pianos
Hugh Everett for immortality, especially for cats
Isaac Newton for his occult studies
Kikunae Ikeda for discovering the secrets of soy sauce
Larry Wall for his website
Louis Camille Maillard for discovering why steaks taste good
Marie Curie for the shiny stuff
Nikola Tesla for the cool cars
Paul Dirac for speaking one word per hour when socializing
Richard Feynman for his bongo skills
Robert Oppenheimer for his in-depth knowledge of the Bhagavad Gita
Rusi P Taleyarkhan for Cold Fusion
Sigmund Freud for his Ménage ā trois
Theodor W Adorno for his contribution to the reception of jazz
Wilhelm Röntgen for the foundations of body scanners
Yulii Borisovich Khariton for the Tsar Bomba
Other (please explain why)