http://qs321.pair.com?node_id=11130086


in reply to Re: How to import "global" variables into sub-scripts from main script?
in thread How to import "global" variables into sub-scripts from main script?

I appreciate the prompt response, thank you.

So, is there really no way to import the variables from the main script? I thought perl was supposed to be good at passing variables.

I don't have a script named "main". I have no idea what perl would think if I tried $main::DEBUG. Is that supposed to "import" the $DEBUG variable? Would I need to do something more like this:  $MyPerlScript.pl::DEBUG? That just looks tacky and ugly, in my opinion.

It makes no sense to me that the error message would complain about a variable not having been imported--if in fact it's not possible to "import" a variable in the first place. That's the part that gets me, I guess.

Blessings,

~Polyglot~