sub new { my $class = shift; my ($min, $max) = ( min(@_), max(@_) ); return bless [ ... ], $class; } Math::Interval->new(...)