Testing a simple Perl module
We have a module called MySimpleCalc.pm with a single function called sum(). It is supposed to return the sum of numbers passed to it.
package MySimpleCalc;
use strict;
use warnings;
use Exporter qw(import);
our @EXPORT_OK = qw(sum);
sub sum {
return $_[0] + $_[1];
}
1;
- sum(1, 3)