Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
and use it as in t.pl:--- - - 1 - sub { print "one" }
but...use YAML; my $s = YAML::LoadFile( "t.yml" ); my $f = $s->[ 0 ]->[ 1 ]; $f->();
Any advice to make this work? Thanks.perl t.pl Undefined subroutine &main::sub { print "one" } called at t.pl line 10 +.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: code reference in YAML
by CountZero (Bishop) on Jan 27, 2011 at 07:21 UTC | |
by Anonymous Monk on Jan 27, 2011 at 17:20 UTC | |
by CountZero (Bishop) on Jan 27, 2011 at 17:24 UTC | |
by roboticus (Chancellor) on Jan 27, 2011 at 18:29 UTC | |
by ikegami (Patriarch) on Jan 27, 2011 at 18:53 UTC | |
by GrandFather (Saint) on Jan 27, 2011 at 23:26 UTC |