Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Dynamically requiring a module

by Bloodnok (Vicar)
on Jan 23, 2014 at 14:33 UTC ( [id://1071760]=note: print w/replies, xml ) Need Help??


in reply to Dynamically requiring a module

At its' simplest, would something along the lines of the following not suffice...
my $module = $ver > 2 ? 'Config' : 'Settings'; require $module; sub get_conf_val { no strict qw/refs/; return ${"$module\::CONFIG"}{shift()}; } my $val = get_conf_val('conf_data_name');

A user level that continues to overstate my experience :-))

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2024-03-19 10:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found