why the code fail in this case?
The only possibly reason is if build_sth('set_to_flag') is called before my %Op = ( ... ); is executed.
Otherwise, it doesn't fail.
sub write_flag { print "write_flag\n"; } sub set_tree { print "set_tree\n"; } sub do_nothing { print "do_nothing\n"; } ... code you provided ... build_sth('set_to_flag'); # Prints write_flag
In reply to Re^3: Function reference undef when extract from hash?
by ikegami
in thread Function reference undef when extract from hash?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |