Hi,
I'm experimenting with Math::Trig and would like to be able to pass the
function in as a parameter:
$f = $opts{f} || &sin;
...
&$f($w);
Undefined subroutine &main::sin called at (eval
9)[/usr/lib/perl5/5.14.2/perl5db.pl:640] line 2.
I have also tried:
$f = &Math::Trig::sin;
Undefined subroutine &Math::Trig::sin called at (eval 10)...
$f = \&sin; # just delays the problem
etc.
Can anyone tell me how to take a reference to func in a module?
TIA
cts
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/