#! /usr/bin/perl -wT use strict; use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use CGI qw(:standard escapeHTML); use Math::MatrixReal; my $matrix1 = Math::MatrixReal->new_from_rows( [ [1, 1, 1, 2], [1, 0, 2, 3],[2,-1, 0,-1], [0, 1, 0, 1] ]); my $matrix2 = Math::MatrixReal->new_from_rows([ [2],[1],[2],[0] ]); print header (), start_html (-title => "Solve Simultaneous Equations"); print "Solution = ", $matrix1->inverse() * $matrix2,"
\n"; print end_html (); exit(0);