{"id":30,"date":"2013-05-05T12:02:04","date_gmt":"2013-05-05T12:02:04","guid":{"rendered":"http:\/\/mobiehl.de\/wordpress\/pc-knowhow\/?p=30"},"modified":"2013-05-05T12:02:04","modified_gmt":"2013-05-05T12:02:04","slug":"perl","status":"publish","type":"post","link":"https:\/\/mobiehl.de\/wordpress\/pc-knowhow\/2013\/05\/05\/perl\/","title":{"rendered":"Perl"},"content":{"rendered":"<p>================================<br \/>\nbday-perltest<br \/>\n================================<\/p>\n<p>#!\/usr\/bin\/perl<br \/>\n#<br \/>\n# Program to show the next birthdays from a listfile<\/p>\n<p>#parameter<br \/>\n$nextbirthdays = 25;<\/p>\n<p>#Datum bestimmen<br \/>\n($sek, $min, $std, $tag, $mon, $jahr) = localtime(time);<br \/>\n$jahr = $jahr + 1900;<br \/>\n$mon++;<br \/>\nprint &#8220;$tag $mon $jahr \\n&#8221;;<\/p>\n<p>$file = &#8216;birthday.ini&#8217;; # Filename zuweisen<br \/>\nopen(INFO, $file); # File \u00f6ffnen<\/p>\n<p>@lines = &lt;INFO&gt;; # alle Zeilen einlesen<br \/>\n$length = @lines; # bestimme Array-L\u00e4nge<\/p>\n<p># for ($i = 0; $i &lt; $length; ++$i)<\/p>\n<p>$i = 0;<br \/>\n$count = 0;<\/p>\n<p>while ($count &lt; $nextbirthdays)<br \/>\n{<\/p>\n<p>@record = split(\/ \/, $lines[$i]); # get day+month<br \/>\n$dayMonth = @record[0]; # get day+month<\/p>\n<p>$birthday = substr($dayMonth, 0, 2); # get birthday<br \/>\n$birthmonth = substr($dayMonth, 3, 2); # get birthmonth<\/p>\n<p>if(<br \/>\n($birthmonth &gt; $mon)<br \/>\nor ( ($birthmonth == $mon) and ($birthday &gt;= $tag) )<br \/>\nor ($count &gt; 0)<br \/>\n)<br \/>\n{<br \/>\nprint $lines[$i]; # Zeilen ausgeben<br \/>\n$count++;<br \/>\n# print &#8220;count $count\\n&#8221;;<br \/>\n# print &#8220;$i\\n&#8221;;<\/p>\n<p>}<br \/>\n# print &#8220;$i\\n&#8221;;<\/p>\n<p>if($i &gt;= $length){<br \/>\n$i = 0;<br \/>\n}<br \/>\nelse{<br \/>\n$i++;<br \/>\n}<br \/>\n}<\/p>\n<p>close(INFO); # File schliessen<\/p>\n<p>================================<br \/>\nbirthday.ini<br \/>\n================================<br \/>\n03.01. 1952 Ma Muster<br \/>\n10.01. 1975 Else<br \/>\n15.01. 1925 Billy Horst<br \/>\n16.01. 0000 Max Molch<br \/>\n24.01. 1978 Klaus Strolch<br \/>\n31.01. 1973 Klaas Clever<\/p>\n","protected":false},"excerpt":{"rendered":"<p>================================ bday-perltest ================================ #!\/usr\/bin\/perl # # Program to show the next birthdays from a listfile #parameter $nextbirthdays = 25; #Datum bestimmen ($sek, $min, $std, $tag, $mon, $jahr) = localtime(time); $jahr = $jahr + 1900; $mon++; print &#8220;$tag $mon $jahr \\n&#8221;; $file = &#8216;birthday.ini&#8217;; # Filename zuweisen open(INFO, $file); # File \u00f6ffnen @lines = &lt;INFO&gt;; # [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[12],"tags":[],"_links":{"self":[{"href":"https:\/\/mobiehl.de\/wordpress\/pc-knowhow\/wp-json\/wp\/v2\/posts\/30"}],"collection":[{"href":"https:\/\/mobiehl.de\/wordpress\/pc-knowhow\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mobiehl.de\/wordpress\/pc-knowhow\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mobiehl.de\/wordpress\/pc-knowhow\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/mobiehl.de\/wordpress\/pc-knowhow\/wp-json\/wp\/v2\/comments?post=30"}],"version-history":[{"count":1,"href":"https:\/\/mobiehl.de\/wordpress\/pc-knowhow\/wp-json\/wp\/v2\/posts\/30\/revisions"}],"predecessor-version":[{"id":31,"href":"https:\/\/mobiehl.de\/wordpress\/pc-knowhow\/wp-json\/wp\/v2\/posts\/30\/revisions\/31"}],"wp:attachment":[{"href":"https:\/\/mobiehl.de\/wordpress\/pc-knowhow\/wp-json\/wp\/v2\/media?parent=30"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mobiehl.de\/wordpress\/pc-knowhow\/wp-json\/wp\/v2\/categories?post=30"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mobiehl.de\/wordpress\/pc-knowhow\/wp-json\/wp\/v2\/tags?post=30"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}