So lets say I have a main.pl
script and in that script I need to declare some variables (any kind of variable constant or normal) and those variables need to be available through all scripts and modules that I'll include from that main.pl
script automatically.
What I mean if I have a variable $myVar
in main.pl
and from main.pl
I require script1.pl
, script2.pl
or script3.pm
, and from anyone of those scripts I need to access $myVar
as you would access any var defined in that specific script or module.
I've searched on the net, but I've only found examples where you can access variables from the scripts you include or extract variables from modules; but that's not what I want.
Isn't there a keyword like in PHP where you would use global $var1, $var2
etc. to use variable from the parent script?
Any example, documentation or article is acceptable - basically anything that could help me accomplish that would be helpful.