Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: 0 illegal modulus?

by ambrus (Abbot)
on Sep 25, 2005 at 21:56 UTC ( #494969=note: print w/replies, xml ) Need Help??

in reply to 0 illegal modulus?

The same thing is also discussed in Re: Illegal Modulus zero.

Replies are listed 'Best First'.
Re^2: 0 illegal modulus?
by Anonymous Monk on May 01, 2012 at 03:35 UTC

    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); }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://494969]
[Discipulus]: i got also a parser error, but once
[KurtZ]: Code Tags
[KurtZ]: ?
[choroba]: <code>...</code>
[choroba]: Discipulus: Yes, all get calls should be wrapped in a Try::Tiny
[choroba]: you can just create a ticket :)
[Discipulus]: Ah! is i'll have some fre4e time i'll try try::tiny

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2017-07-24 09:29 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (349 votes). Check out past polls.