- or download this
printf ("%d %s%s\n", $count, "cat", ($count==1)?"":"s");
printf ("%d %s%s\n", $count, "cact", ($count==1)?"us":"i");
printf ("%d %s%s\n", $count, "Elvi", ($count==1)?"s":"i");
- or download this
print $count, "cat", (($count==1)?"":"s"), "\n";
print $count, "cact", (($count==1)?"us":"i"), "\n";
print $count, "Elvi", (($count==1)?"s":"i"), "\n";
- or download this
sub quantize
{
my ($quantity, $singular, $plural) = @_;
...
$count = 2;
print "$count @{[quantize($count,'cat','cats')]}\n";