in reply to Finding the right initialization-file module
YAML is what I would use for such a task. With a little OO help you can even do the "by name" function stuff:
use strict; use warnings; use YAML; my $yamlStr = <<YAML; --- flamencoArgs: spec: PAGE_HEADING: SABER Software Requirements Oct Release PAGE_TITLE: SABER Requirements topArgs: fileReadFn: eat_AvionicsFMEA hiliteCol: - 1 - 3 - 4 - 5 xtraTh: 1: colspan: 2 text: ' ' 3: colspan: 4 text: Front YAML my $stuff = bless YAML::Load($yamlStr); my $fn = $stuff->can ($stuff->{topArgs}{fileReadFn}); $fn->() if $fn; sub eat_AvionicsFMEA { print "Hey, how about that!\n"; }
Prints:
Hey, how about that!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Finding the right initialization-file module
by throop (Chaplain) on Dec 13, 2011 at 20:09 UTC | |
by GrandFather (Saint) on Dec 13, 2011 at 21:40 UTC |