in reply to How we can link/access the variables of different module in main script without defining variable as global.. ??

There are several mechanisms available to access the contents of variables declared inside a package.

If you follow the link and learn about Symbol tables, package scope (our) then some of these mechanisms may be useful.

However , the most robust and common method of extracting data from packages is to use accessors, which is essentially a sub inside a package that returns the value of the variable you seek.

If you need to MODIFY the value, you typically use a mutator - google these terms to get a better idea of how they are used.

        What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?
              -Larry Wall, 1992

  • Comment on Re: How we can link/access the variables of different module in main script without defining variable as global.. ??