Re: how to do a reference to a func in Math::Trig

2012-06-24 Thread Charles Smith
Thank you. The useful note about CORE, in particular, is new to me. cts --- On Sun, 6/24/12, Rob Dixon wrote: > From: Rob Dixon > Subject: Re: how to do a reference to a func in Math::Trig > To: "Perl Beginners" > Cc: "Charles Smith" > Date: Sunday, June 24, 2012, 11:53 AM > On 24/06/2012 1

Re: how to do a reference to a func in Math::Trig

2012-06-24 Thread Rob Dixon
On 24/06/2012 19:51, Rob Dixon wrote: or by aliasing the current package's 'sin' and 'cos' subroutines with the CORE functions: use strict; use warnings; use Math::Trig; BEGIN { no warnings 'once'; *sin = \&CORE::sin; *cos = \&CORE::cos; } f

Re: how to do a reference to a func in Math::Trig

2012-06-24 Thread Rob Dixon
On 24/06/2012 06:59, Charles Smith wrote: Thank you, that was the clue I needed! This now works for me: ... $f = $opts{f} || "sin"; ... $f = "Math::Complex::$f"; ... print eval ($amplitude) * (&$f (2 * pi * $i/$n) + eval ($dc))."\n"; and so I can use this, my "siggen" pgm wit