[boulder.pm] line/loop optimization?

Rob Nagler nagler at bivio.com
Tue May 8 12:45:55 CDT 2001


Why not use perl itself?  We have lots of config files and they are all
perl, sometimes with one or two substitutions to make it easy.

You could change the syntax to be:

{
   OPTION1 => 'value1',
   OPTION2 => 'value2',
};

Which is parsed by:

    my($info) = do($file);
    die($@) if $@;
    die($file, ": didn't return a hash_ref")
	    unless ref($info) eq 'HASH';

The syntax errors will be clearer, the parser is already debugged,
and it will probably be a lot faster than an custom solution.  If
you need security, use safeperl.

W

Rob



More information about the Boulder-pm mailing list