Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Lazy config files?

by Ryszard (Priest)
on Aug 28, 2003 at 08:36 UTC ( [id://287276]=note: print w/replies, xml ) Need Help??


in reply to Lazy config files?

For my config files i use a perl module, then dereference the data structure. It may become difficult to use when scaled excessively, but works well in my situation.
Package Attr; use strict; use vars qw(%struct); %struct = ( foo => 'bar'. baz => { blah => 1, } ); 1
and to use it:
#!/usr/bin/perl -w use strict; use Attr; use vars qw(%struct); *struct = \%Attr::struct;

Replies are listed 'Best First'.
Re: Re: Lazy config files?
by bsb (Priest) on Aug 28, 2003 at 09:20 UTC
    Yeah, I kinda like evalling a file instead of parsing names and values. It leaves the design open, you can put custom behavior in there as well as just values.

    I might try to mix this approach with Data::Lazy.

    Ta

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-25 15:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found