in reply to Re^9: Function name in a variable, can't recall the concept (introspection with ->can )
in thread Function name in a variable, can't recall the concept
Oh yeah, haha, what have I been smoking!
I'll probably stick with this then:
sub get_sub_by_name { my ($pkg, $name) = @_ ; no strict 'refs' ; if ( defined &{$pkg . '::'. $name} ) { return \&{$pkg . '::'. $name} ; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^11: Function name in a variable, can't recall the concept (introspection with ->can )
by ikegami (Patriarch) on Apr 19, 2019 at 18:06 UTC | |
by Veltro (Hermit) on Apr 19, 2019 at 18:35 UTC | |
by ikegami (Patriarch) on Apr 19, 2019 at 18:55 UTC | |
|
Re^11: Function name in a variable, can't recall the concept (introspection with ->can )
by LanX (Saint) on Apr 19, 2019 at 18:52 UTC |