Application using random



examples/mock-random/lib/MyRandomApp.pm
package MyRandomApp;
use strict;
use warnings;

use Exporter qw(import);
our  @EXPORT_OK = qw(dice);

sub dice {
    my ($n) = @_;
    return 1 + int(rand() * $n);
}

1;

examples/mock-random/bin/dice.pl
use strict;
use warnings;
use 5.010;

use MyRandomApp qw(dice);

say dice(6);
say dice(6);
say dice(6);

perl -Ilib bin/dice.pl