Skip to content

Instantly share code, notes, and snippets.

@technix
technix / getmul.pl
Created February 13, 2012 10:32 — forked from spiculator/getmul.pl
getmul
#!/usr/bin/perl
use warnings;
use strict;
sub getmul($$$$) {
my $num = shift;
my $num2 = $num % 100;
my $last = $num2 % 10;
my $case = $num2 > 4 && $num2 < 21 ? 2 :
1 == $last ? 0 :
$last > 1 && $last < 5 ? 1