Jim Ockers wrote:
>
> 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 };
Is there any reason that you can't use
Math::MatrixReal->new_from_cols()? Anyway, to expand expressions or
function calls in strings:
perldoc -q "How do I expand function calls in a string"
Found in /usr/lib/perl5/5.6.0/pod/perlfaq4.pod
How do I expand function calls in a string?
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]