[ABE.pm] Config files

Ricardo SIGNES rjbs-perl-abe at lists.manxome.org
Sat Mar 5 09:50:18 PST 2005


* Faber Fedor <faber at linuxnj.com> [2005-03-05T12:22:36]
> I want to include a config file in my application.  IT just consists (so
> far) of a bunch of
> 
> $foo=bar;
> $bar=foo;
> 
> and the like.
>
> What's the canonical way to include that file in my program?  I tried 

It is not something that is generally done.  One doesn't usually
evaluate some external Perl and have its scope merged with the current
one.

Have you looked at any of the Config:: modules?  Personally, I tend to
use YAML for this sort of thing.  Check out the YAML module.

typical yaml file (indented by one tab):
	foo: bar
	bar: foo
	people:
		bob: banker
		ted: lawyer
		joe: pizza guy
	hosts:
		- host1
		- host2
		- host3

Config::Auto is good, too.

-- 
rjbs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.pm.org/pipermail/abe-pm/attachments/20050305/b3eba6f9/attachment.bin


More information about the ABE-pm mailing list