in reply to function inline evaluation (formated *gg*)
"cos" isn't a defined subroutine, it's a Perl thing, and AFAIK, you can't reference it as "\&cos" like you can for your own subs.$i = 3; $func = sub { cos ($_[0]) }; print "Das ist ",&$func($i),"\n";
This produces "Undefined subroutine &main::cos called at evl line 7."$i = 3; $func = "cos"; print "Das ist ",&{$func}($i),"\n";
|
|---|