Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^4: How to import "global" variables into sub-scripts from main script?

by Polyglot (Friar)
on Mar 22, 2021 at 09:55 UTC ( #11130089=note: print w/replies, xml ) Need Help??


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

Variable "%s" is not imported%s

(S misc) With "use strict" in effect, you referred to a global variable that you apparently thought was imported from another module, because something else of the same name (usually a subroutine) is exported by that module. It usually means you put the wrong funny character on the front of your variable.

I did run across that one earlier in my quest for a resolution, but found it of no use to me--too esoteric and short on detail. I have no idea what the "right" "funny character" should be--or even what a "funny character" is supposed to refer to--the dollar sign, perhaps? What else would one prefix a scalar variable with?

I guess there's no easy answer. Best, in my case, might be just to turn "strict" back off and continue my troubleshooting without its bungling "help." Sorry to have troubled the waters here for nothing.

Blessings,

~Polyglot~

  • Comment on Re^4: How to import "global" variables into sub-scripts from main script?

Replies are listed 'Best First'.
Re^5: How to import "global" variables into sub-scripts from main script?
by marto (Cardinal) on Mar 22, 2021 at 10:06 UTC

    "What else would one prefix a scalar variable with?"

    It doesn't have to be a scalar, it could be something else, for example a hash, so the character before the variable name would be different. For what it's worth I agree this part of the documentation could do with some work to make things clearer.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11130089]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2021-09-28 13:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?