#!/usr/bin/perl
# Perl script to write time as spoken in English. Not very fancy. Very brute force.
#get local time
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdat) = localtime(time);
# define hour word array
@hour_words = ("Zwölf", "Eins", "Zwei", "Drei", "Vier", "Fünf", "Sechs", "Sieben", "Acht", "Neun", "Zehn", "Elf");
if ($min == 0) { print $hour_words[$hour%12], "Uhr\n"; }
elsif ($min == 1) { print "Eins nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 2) { print "Zwei nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 3) { print "Drei nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 4) { print "Vier nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 5) { print "Fünf nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 6) { print "Sechs nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 7) { print "Sieben nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 8) { print "Acht nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 9) { print "Neun nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 10) { print "Zehn nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 11) { print "Elf nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 12) { print "Zwölf nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 13) { print "Dreizehn nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 14) { print "Vierzehn nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 15) { print "Viertel nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 16) { print "Sechszehn nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 17) { print "Siebzehn nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 18) { print "Achtzehn nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 19) { print "Neunzehn nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 20) { print "Zwanzig nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 21) { print "Einundzwanzig nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 22) { print "Zweiundzwanzig nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 23) { print "Dreiundzwanzig nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 24) { print "Vierundzwanzig nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 25) { print "Fünfzundwanzig nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 26) { print "Sechsundzwanzig nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 27) { print "Siebenundzwanzig nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 28) { print "Achtundzwanzig nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 29) { print "Neunundzwanzig nach ", $hour_words[$hour%12], "\n"; }
elsif ($min == 30) { print "Halb ", $hour_words[$hour%12], "\n"; }
elsif ($min == 31) { print "Neunundzwanzig vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 32) { print "Achtundzwanzig vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 33) { print "Siebenundzwanzig vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 34) { print "Sechsundzwanzig vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 35) { print "Fünfundzwanzig vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 36) { print "Vierundzwanzig vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 37) { print "Dreiundzwanzig vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 38) { print "Zweiundzwanzig vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 39) { print "Einundzwanzig vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 40) { print "Zwanzig vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 41) { print "Neunzehn vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 42) { print "Achtzehn vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 43) { print "Siebzehn vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 44) { print "Sechzehn vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 45) { print "Viertel vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 46) { print "Vierzehn vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 47) { print "Dreizehn vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 48) { print "Zwölf vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 49) { print "Elf vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 50) { print "Zehn vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 51) { print "Neun vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 52) { print "Acht vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 53) { print "Sieben vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 54) { print "Sechs vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 55) { print "Fünf vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 56) { print "Vier vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 57) { print "Drei vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 58) { print "Zwei vor ", $hour_words[($hour+1)%12], "\n"; }
elsif ($min == 59) { print "Eins vor ", $hour_words[($hour+1)%12], "\n"; }</string>