in reply to Re^2: yaml dynamically load in perl
in thread yaml dynamically load in perl

Not sure if this answers your general question, but here are some specific alternatives:

c:\@Work\Perl\monks>perl -wMstrict -le "my $my_print = sub { print qq{howdy @_}; }; ;; my $conf = { 'cmd' => $my_print }; ;; &{ $conf->{'cmd'} }; $conf->{'cmd'}->('there'); $conf->{cmd}('doody'); " howdy howdy there howdy doody


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^4: yaml dynamically load in perl
by louie_45 (Acolyte) on Nov 02, 2015 at 14:26 UTC
    The point is that we need work with Yaml format:
    cmd:!perl/ref my_print
    Not directly with perl anonymous subroutine.