in reply to Need to share and modify global variables across modules and packages.
Came to know that it can be done using classes, but is there a plain way to do it Any suggestions ???
Its unclear what a.pl and b.pl are and how you're running them, so maybe post code to explain that
You can use $packagename::global = 12; to change the original
I suspect you might benefit from reading Tutorials: Simple Module Tutorial, Variable Scoping in Perl: the basics, Coping with Scoping , Mini-Tutorial: Perl's Memory Management, Lexical scoping like a fox, Of Symbol Tables and Globs,
|
|---|