solitaryrpr has asked for the wisdom of the Perl Monks concerning the following question:
this would have to be generated from the config file with the format:'domain1' => [ { 'libname' => 'foo', 'pathname' => '/path/to/metadata', 'owner' => 'someuser', 'libaclinherit' => 'yes|no', 'dynlock' => 'yes|no', 'options|roptions' => [ { 'datapath' => [ '/data/path01', '/data/path02', '/data/path03', ... ], 'indexpath' => [ '/indx/path1', '/indx/path2', '/indx/path3', ... ], 'workpath' => [ '/work/path1', '/work/path2', '/work/path3', ... ], 'metapath' => [ '/meta/path1', '/meta/path2', '/meta/path3', ... ] } ] } ], 'domain2' => [ { 'libname' => 'bar', 'pathname' => '/path/to/metadata', 'owner' => 'someuser', 'libaclinherit' => 'yes|no', 'dynlock' => 'yes|no' 'options|roptions' => [ { 'datapath' => [ '/data/path01', '/data/path02', '/data/path03', ... ], 'indexpath' => [ '/indx/path1', '/indx/path2', '/indx/path3', ... ], 'workpath' => [ '/work/path1', '/work/path2', '/work/path3', ... ], 'metapath' => [ '/meta/path1', '/meta/path2', '/meta/path3', ... ] } ] } ]
libname=foo pathname=/path/to/metadata/foo owner=someuser libaclinherit=no dynlock=no roptions=" datapath=('/data/path1' '/data/path2' '/data/path3' ...) indexpath=('/indx/path1' '/indx/path2' '/indx/path3' ...) workpath=('/work/path1' '/work/path2' '/work/path3' ...) metapath=('/meta/path1' '/meta/path2' '/meta/path3' ...)"; libname=bar pathname=/path/to/metadata/bar owner=someuser libaclinherit=no dynlock=no roptions=" datapath=('/data/path1' '/data/path2' '/data/path3' ...) indexpath=('/indx/path1' '/indx/path2' '/indx/path3' ...) workpath=('/work/path1' '/work/path2' '/work/path3' ...) metapath=('/meta/path1' '/meta/path2' '/meta/path3' ...)";This parsing has to be able to handle the fact that everything after 'pathname' is optional. The simplest entry being:
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Parsing a complex config file
by ikegami (Patriarch) on Jul 12, 2006 at 05:45 UTC | |
by Anonymous Monk on Jul 12, 2006 at 13:29 UTC | |
Re: Parsing a complex config file
by Zaxo (Archbishop) on Jul 12, 2006 at 05:59 UTC | |
by solitaryrpr (Acolyte) on Jul 12, 2006 at 14:00 UTC | |
Re: Parsing a complex config file
by GrandFather (Saint) on Jul 12, 2006 at 09:19 UTC | |
by solitaryrpr (Acolyte) on Jul 12, 2006 at 14:08 UTC | |
by solitaryrpr (Acolyte) on Jul 12, 2006 at 17:33 UTC | |
Re: Parsing a complex config file
by dimar (Curate) on Jul 12, 2006 at 15:41 UTC | |
by solitaryrpr (Acolyte) on Jul 12, 2006 at 18:46 UTC |