Charles Smith wrote:

[snip]
>
> But this pgm fails:
>
> #!/usr/bin/env perl
> use Math::Trig;
> my $a = \&Math::Trig::cos;
> &$a(0);
>
> Undefined subroutine &Math::Trig::cos called at modfunctor line 7.
>

The cos sub is defined in Math::Complex, which Math::Trig loads.

Try this:

use strict;
use Math::Trig;

my $cos = \&Math::Complex::cos;
print $cos->(0);



-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to