Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Accessing module variables

by talexb (Chancellor)
on Apr 19, 2018 at 22:49 UTC ( [id://1213199]=note: print w/replies, xml ) Need Help??


in reply to Re: Accessing module variables
in thread Accessing module variables

    If you have many modules with such data (really password in modules? I'm sure you are aware already of this..)

I wanted something quick that wouldn't involve me putting credentials into the scripts themselves .. and would also allow the credentials to be shared between multiple scripts. Putting them in a module that wasn't covered by version control seemed to be the easy solution.

In hindsight, a better way would have been to create a credentials module that would do a lookup in a JSON configuration file .. just so I don't have to copy the four lines of code to open, read and transform JSON into a Perl data structure. That's for the future, I guess.

Anyway, I have a solution that works fine right now. Thanks for the feedback.

Alex / talexb / Toronto

Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-20 02:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found