http://www.perlmonks.org?node_id=968202


in reply to Re: 0 illegal modulus?
in thread 0 illegal modulus?

This seems to work great, thank you!

#use DateTime::Util::Calc qw(mod); #sub mod { $_[1]*1 ? $_[0] % $_[1] : 0);} sub mod { my($x)=$_[0]; my($y)=$_[1]; while($x >= 0){ $x-=$y; } $x+=$y; return($x); }