- or download this
class Float
alias :old_divide :/
...
other == 0 ? nil : old_divide(other)
end
end
- or download this
class MyFloat < Float
def MyFloat.new(from)
...
end
end
MyFloat.new(4) / 0 # nil
- or download this
use warnings;
...
no warnings qw/uninitialized/;
$foo = 5 - $qux;
}