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.
examples/test-simple/lib/MySimpleCalc.pm
package MySimpleCalc; use strict; use warnings; use Exporter qw(import); our @EXPORT_OK = qw(sum); sub sum { return $_[0] + $_[1]; } 1;
- sum(1, 3)