in reply to Re: Surviving 'Illegal division by zero'
in thread Surviving 'Illegal division by zero'

Thanks, but I've got lots and lots of these calculations, and what I'd like to be able to do is scope-globally adjust the behaviour, rather than have to wrap every block in either an eval or a conditional.

On reflection, a function mydiv:

sub mydiv { my ( $divided, $divisor ) = @_; $divisor ? $divided / $divisor : undef; } my $growth = mydiv($fig_2, $fig_1);

Might have been easier, but Abigail-II's answer is another way of getting to it as well.

Thanks
Alex