in reply to Modulo operation to return quotient and remainder

I'm not aware of any module that does this but it's easy enough to roll your own:

$ perl -Mstrict -Mwarnings -E ' my ($var, $mod) = (4999, 100); my ($quot, $rem) = (int $var / $mod, $var % $mod); say $quot; say $rem; ' 49 99

-- Ken

Replies are listed 'Best First'.
Re^2: Modulo operation to return quotient and remainder
by Anonymous Monk on Sep 08, 2015 at 15:37 UTC
    Just a note if you're using negative values: depending on your application, you might want to use floor() instead of int(). This bit me a while back.