in reply to Re:yaml dynamically load in perl
in thread yaml dynamically load in perl
Thanks a lot for your inputs. Would check tied hash later.
And could you show my how to call the 'CODE' or 'ref' in Yaml.For instance, Here is Yaml format: cmd:!perl/ref my_print
Perl Code:How do I make 'cmd' to call $my_print after load the Yaml file into $conf like:$my_print = sub { print "howdy"; };
To make it run and print "howdy".&{ $conf->{"cmd"} }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: yaml dynamically load in perl
by AnomalousMonk (Archbishop) on Nov 02, 2015 at 13:39 UTC | |
by louie_45 (Acolyte) on Nov 02, 2015 at 14:26 UTC |