in reply to Suggest me some code to share an array among packages???
Please read perlref, read the caveat at the bottom of the code snippet's node, read e.g. Of Symbol Tables and Globs, do a Super Search on glob, to get an idea of what this is all about.
It's generally a better idea not to share, and if you absolutely must do it, don't use typeglobs. Instead, access shared variables from other packages qualifying them with their full package name, i.e. access @shared_array in package Foo as @Foo::shared_array from outside.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|