#!/usr/bin/perl

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

$matrix = pdl [[5, 3], [2, 7], [8, 10]];

print $matrix, "\n";

$row = $column = 1;

$elem = at($matrix, $row, $column);         # access

print "The element at $row, $column is $elem.\n";

print "Setting that element to 4.\n";
set($matrix, $row, $column, 4);        # modify

print $matrix, "\n";

($columns, $rows) = dims $matrix;

print "The dimensions of that matrix are $rows x $columns.\n";