Sunday, August 3, 2014

Perl: Exporting Static Methods with Moose and Sub::Exporter

Simple how to on exporting static metods with Moose and Sub::Exporter.
package Utils;

=head
   UTILS
=cut

use Moose;
use Carp qw/carp/;
use Sub::Exporter -setup => {
  exports => [
    qw(normalize bounds min max)
  ]
};

sub max {
  my ($value, $compare) = @_;
}
sub min {
  my ($value, $compare) = @_;
}
sub normalize {
  my ($value, $compare) = @_;
}