From: Jim Ockers <[EMAIL PROTECTED]> > Is there any concise method of fully evaluating the arithmetic > expressions in here documents, rather than just one level of > substitution?: > > sub RotationMatrix { > my $theta = $_[0] * 3.14159265 / 180.0; > my $m = cos($theta); > my $n = sin($theta); > my $T = Math::MatrixReal->new_from_string(<<"ROTMATRIX"); > [ $m**2 $n**2 2*$m*$n ] > [ $n**2 $m**2 -2*$m*$n ] > [ -$m*$n $m*$n $m**2-$n**2 ] > ROTMATRIX > return $T };
use Interpolation '=' => 'eval'; .... my $T = Math::MatrixReal->new_from_string(<<"ROTMATRIX"); [ $={$m**2} $={$n**2} $={2*$m*$n} ] [ $={$n**2} $={$m**2} $={-2*$m*$n} ] [ $={-$m*$n} $={$m*$n} $={$m**2-$n**2} ] ROTMATRIX You may find Interpolation.pm on CPAN and http://Jenda.Krynicky.cz/#Interpolation HTH, Jenda =========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ========== There is a reason for living. There must be. I've seen it somewhere. It's just that in the mess on my table ... and in my brain I can't find it. --- me -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]