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

Re: What's the right way to include a config file as a .pm bareword?

by vinoth.ree (Monsignor)
on Aug 07, 2015 at 08:03 UTC ( [id://1137802]=note: print w/replies, xml ) Need Help??


in reply to What's the right way to include a config file as a .pm bareword?

Even you can use do() to include .pl file, as below.

use strict; use warnings; use Data::Dumper; our $config = do '/pathto/config.pl'; print $config->{'foo'};

All is well. I learn by answering your questions...
  • Comment on Re: What's the right way to include a config file as a .pm bareword?
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-19 14:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found