in reply to Can't call method "abs" on an undefined value.

Not an answer, but I wonder why you do
sub _interval { my ($min, $max) = ( min(@_), max(@_) ); return bless [ ... ], __PACKAGE__; } Math::Interval::_interval(...)
instead of
sub new { my $class = shift; my ($min, $max) = ( min(@_), max(@_) ); return bless [ ... ], $class; } Math::Interval->new(...)

Replies are listed 'Best First'.
Re^2: Can't call method "abs" on an undefined value.
by HollyKing (Pilgrim) on May 05, 2006 at 23:35 UTC

    It was cut and pasted from some code in Perl Hacks. Damn Damian, chromatic and Ovid for publishing a book with some very similar code to the module I'm writing.

    I was experimenting with some of the hacks and didn't want to clash with my existing new() constructor.

    Owl looked at him, and wondered whether to push him off the tree; but, feeling that he could always do it afterwards, he tried once more to find out what they were talking about.