Incidently, this is what I wrote back:
> 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 with gnuplot:
>
> plot "<(./siggen -f cos -p 2 -n66 )" lc 1
>
> to get a nice curve.
>
> Unfortunately, though, I was only able to get it to work as symbolic reference. First I tried:
>
> $f = \&Math::Complex::$func;
>
> Scalar found where operator expected at ./siggen line 194, near "&Math::Complex::$func"
> (Missing operator before $func?)
> syntax error at ./siggen line 194, near "&Math::Complex::$func"
>
> I also tried:
>
> $f = eval (\&Math::Complex::$func)
>
> but that didn't help.
>
> But that's all unimportant, because my pgm works now,
> thank you.
>
> cts