#!/usr/bin/perl

# You can retrieve modules from http://www.perl.com/CPAN/modules/by-module.
use Math::MatrixReal;

$matrix = Math::MatrixReal->new_from_string(<<'MATRIX');
[ 5  3 ]
[ 2  7 ]
[ 8 10 ]
MATRIX

print $matrix;

# Set $elem to the element of $matrix at ($row, $column)

$elem = element $matrix (2, 2);
print "\nThe element at (2, 2) is ", $elem, "\n\n";

# Setting the element of $matrix at ($row, $column) to $value
print "Set (2, 2) to 1000.\n\n";
assign $matrix (2, 2, 1000);

print $matrix;

($rows, $columns) = dim $matrix;
print "The dimensions of the matrix are $rows x $columns.\n";
