# expl8.pl  example  use external functions, procedures, subroutines
#           uses  expl8m.pm   in local directory
use strict;

print "perl  expl8.pl  running \n";

use my::expl8m qw(&matadd &matsub ); # could be many more

my @mat1 = ([1, 2], [3, 4], [5, 6]);
my @mat2 = ([10, 11, 12], [13, 14, 15]);
my @mat3 = ([2, 3], [4, 5], [6, 7]);
my @sum =  ([0, 0], [0, 0], [0, 0]);

print "print mat1, mat2, mat3 \n";
matprt("mat1", \@mat1);
print "\n";
matprt("mat2", \@mat2);
print "\n";
matprt("mat3", \@mat3);
print "\n";

matadd(\@mat1, \@mat3, \@sum);
print "matadd sum= \n";
matprt("sum", \@sum);
print "\n";

my @dif;
matsub(\@mat3, \@mat1, \@dif);
print "matsub \@ dif= \n";
matprt("dif", \@dif);
print "\n";

print "expl8.pl finished\n";
