Skip to content

Instantly share code, notes, and snippets.

@tskrynnyk
Created May 25, 2012 22:18
Show Gist options
  • Select an option

  • Save tskrynnyk/2790897 to your computer and use it in GitHub Desktop.

Select an option

Save tskrynnyk/2790897 to your computer and use it in GitHub Desktop.
Plural in Polish
#! /usr/bin/perl
#
if (($#ARGV+1) == 1) {
$i = $ARGV[0];
$plural = $i == 1 ? 'znak' : $i % 10 >= 2 && $i % 10 <= 4 && ($i % 100 < 10 || $i % 100 >= 20) ? 'znaki' : 'znaków';
print "$i $plural\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment