A
Arne Gödeke
hey everyone,
is there a possibility to create anonymous subroutines at runtime with code-refs inside?
I am aware of 'eval' but I cannot get it working like this (example to makeclear what I want):
$callback = sub { "some code" }
$cb = eval "sub { &{$cb}(); }"; # This certainly fails.. since CODE(0xwhatever) is not a code-ref
$cb should then be passed somewhere else. Basically, I just want to create nested anonymous subroutines..
thanks in advance!
arne gödeke
is there a possibility to create anonymous subroutines at runtime with code-refs inside?
I am aware of 'eval' but I cannot get it working like this (example to makeclear what I want):
$callback = sub { "some code" }
$cb = eval "sub { &{$cb}(); }"; # This certainly fails.. since CODE(0xwhatever) is not a code-ref
$cb should then be passed somewhere else. Basically, I just want to create nested anonymous subroutines..
thanks in advance!
arne gödeke