<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Frank Seitz' Developer Logbuch - Perl</title>
    <link>http://fseitz.de/blog/</link>
    <description>Notizen aus der Welt der Web-, Datenbank- und Unix-Programmierung</description>
    <dc:language>de</dc:language>
    <generator>Serendipity 1.5.1 - http://www.s9y.org/</generator>
    <pubDate>Fri, 28 May 2010 04:12:31 GMT</pubDate>

    <image>
        <url>http://fseitz.de/blog/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Frank Seitz' Developer Logbuch - Perl - Notizen aus der Welt der Web-, Datenbank- und Unix-Programmierung</title>
        <link>http://fseitz.de/blog/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Perl: POD als Programm-Hilfetext</title>
    <link>http://fseitz.de/blog/index.php?/archives/39-Perl-POD-als-Programm-Hilfetext.html</link>
            <category>Perl</category>
    
    <comments>http://fseitz.de/blog/index.php?/archives/39-Perl-POD-als-Programm-Hilfetext.html#comments</comments>
    <wfw:comment>http://fseitz.de/blog/wfwcomment.php?cid=39</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://fseitz.de/blog/rss.php?version=2.0&amp;type=comments&amp;cid=39</wfw:commentRss>
    

    <author>nospam@example.com (Frank Seitz)</author>
    <content:encoded>
    &lt;p class=&quot;sdoc-para-p&quot;&gt;
  Das Core-Modul &lt;tt class=&quot;sdoc-seg-c&quot;&gt;Pod::Usage&lt;/tt&gt; kann einen Programm-Hilfetext aus der
  eingebetteten POD-Dokumentation generieren. Es geht auch einfacher:
&lt;/p&gt;
&lt;table class=&quot;sdoc-code-table&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 1&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;#!/usr/bin/env perl&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 2&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 3&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;pt-w&quot;&gt;strict&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 4&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;pt-w&quot;&gt;warnings&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 5&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 6&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-pd&quot;&gt;=head1 NAME&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 7&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 8&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-pd&quot;&gt;myprog - a simple program&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 9&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;10&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-pd&quot;&gt;=head1 LICENSE&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;11&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;12&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-pd&quot;&gt;This program is free software; you can redistribute it and/or&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;13&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-pd&quot;&gt;modify it under the same terms as Perl itself.&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;14&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;15&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-pd&quot;&gt;=cut&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;16&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;17&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-k&quot;&gt;exec&lt;/span&gt; &lt;span class=&quot;pt-q&quot;&gt;&amp;#39;pod2text&amp;#39;&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;$0&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;18&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;19&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-c&quot;&gt;# eof&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  produziert auf STDOUT
&lt;/p&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;NAME&amp;#10;    myprog - a simple program&amp;#10;&amp;#10;LICENSE&amp;#10;    This program is free software; you can redistribute it and/or modify it&amp;#10;    under the same terms as Perl itself.&amp;#10;&amp;#10;&lt;/pre&gt;
&lt;/div&gt; 
    </content:encoded>

    <pubDate>Thu, 20 May 2010 10:59:21 +0200</pubDate>
    <guid isPermaLink="false">http://fseitz.de/blog/index.php?/archives/39-guid.html</guid>
    
</item>
<item>
    <title>Perl: Plus / Minus Unendlich</title>
    <link>http://fseitz.de/blog/index.php?/archives/37-Perl-Plus-Minus-Unendlich.html</link>
            <category>Perl</category>
    
    <comments>http://fseitz.de/blog/index.php?/archives/37-Perl-Plus-Minus-Unendlich.html#comments</comments>
    <wfw:comment>http://fseitz.de/blog/wfwcomment.php?cid=37</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://fseitz.de/blog/rss.php?version=2.0&amp;type=comments&amp;cid=37</wfw:commentRss>
    

    <author>nospam@example.com (Frank Seitz)</author>
    <content:encoded>
    &lt;p class=&quot;sdoc-para-p&quot;&gt;
  Perl kennt mehrere Zeichenketten, die - numerisch interpretiert - plus
  und minus Unendlich bedeuten.
&lt;/p&gt;
&lt;table class=&quot;sdoc-keyval-table&quot;&gt;
&lt;tr class=&quot;sdoc-keyval-tr&quot;&gt;
  &lt;td class=&quot;sdoc-keyval-td-key&quot;&gt;Plus Unendlich:&lt;/td&gt;
  &lt;td class=&quot;sdoc-keyval-td-value&quot;&gt;&lt;tt class=&quot;sdoc-seg-c&quot;&gt;&#039;+inf&#039;&lt;/tt&gt;, &lt;tt class=&quot;sdoc-seg-c&quot;&gt;&#039;+infinity&#039;&lt;/tt&gt;, &lt;tt class=&quot;sdoc-seg-c&quot;&gt;&#039;inf&#039;&lt;/tt&gt;, &lt;tt class=&quot;sdoc-seg-c&quot;&gt;&#039;infinity&#039;&lt;/tt&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-keyval-tr&quot;&gt;
  &lt;td class=&quot;sdoc-keyval-td-key&quot;&gt;Minus Unendlich:&lt;/td&gt;
  &lt;td class=&quot;sdoc-keyval-td-value&quot;&gt;&lt;tt class=&quot;sdoc-seg-c&quot;&gt;&#039;-inf&#039;&lt;/tt&gt;, &lt;tt class=&quot;sdoc-seg-c&quot;&gt;&#039;-infinity&#039;&lt;/tt&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  &lt;b class=&quot;sdoc-seg-b&quot;&gt;Beispiel:&lt;/b&gt; Maximum ermitteln
&lt;/p&gt;
&lt;table class=&quot;sdoc-code-table&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 1&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$max&lt;/span&gt; = &lt;span class=&quot;pt-q&quot;&gt;&amp;#39;-inf&amp;#39;&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 2&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$n&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pt-n&quot;&gt;-100&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-n&quot;&gt;-10&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-n&quot;&gt;-50&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;{&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 3&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;    &lt;span class=&quot;pt-i&quot;&gt;$max&lt;/span&gt; = &lt;span class=&quot;pt-i&quot;&gt;$n&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$n&lt;/span&gt; &amp;gt; &lt;span class=&quot;pt-i&quot;&gt;$max&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 4&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-s&quot;&gt;}&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 5&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-k&quot;&gt;say&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$max&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 6&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;a name=&quot;__END__&quot;&gt;&lt;/a&gt;&lt;span class=&quot;pt-k&quot;&gt;__END__&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 7&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-q&quot;&gt;-10&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  &lt;b class=&quot;sdoc-seg-b&quot;&gt;Aber Achtung:&lt;/b&gt; Diese besonderen Werte sind nicht sonderlich gut
  dokumentiert und scheinen bei einigen Windows-Ports nicht zu
  funktionieren. Siehe:
  &lt;a class=&quot;sdoc-seg-u&quot; href=&quot;http://reneeb-perlblog.blogspot.com/2010/03/unendliches-perl.html&quot;&gt;http://reneeb-perlblog.blogspot.com/2010/03/unendliches-perl.html&lt;/a&gt;
&lt;/p&gt; 
    </content:encoded>

    <pubDate>Thu, 25 Mar 2010 08:23:55 +0100</pubDate>
    <guid isPermaLink="false">http://fseitz.de/blog/index.php?/archives/37-guid.html</guid>
    
</item>
<item>
    <title>Perl: Dirhandles objektorientiert</title>
    <link>http://fseitz.de/blog/index.php?/archives/35-Perl-Dirhandles-objektorientiert.html</link>
            <category>Perl</category>
    
    <comments>http://fseitz.de/blog/index.php?/archives/35-Perl-Dirhandles-objektorientiert.html#comments</comments>
    <wfw:comment>http://fseitz.de/blog/wfwcomment.php?cid=35</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://fseitz.de/blog/rss.php?version=2.0&amp;type=comments&amp;cid=35</wfw:commentRss>
    

    <author>nospam@example.com (Frank Seitz)</author>
    <content:encoded>
    &lt;p class=&quot;sdoc-para-p&quot;&gt;
  Analog zu lexikalischen Filehandles besitzt Perl lexikalische
  Dirhandles. Eine Dirhandle ist ein Iterator über einem Verzeichnis.
  Die Operationen auf Dirhandles lassen sich objektorientiert kapseln.
&lt;/p&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Hier eine entsprechende Klasse &lt;tt class=&quot;sdoc-seg-c&quot;&gt;Dirhandle&lt;/tt&gt; mit drei
  Methoden: &lt;tt class=&quot;sdoc-seg-c&quot;&gt;new()&lt;/tt&gt; (Directory öffnen), &lt;tt class=&quot;sdoc-seg-c&quot;&gt;close()&lt;/tt&gt; (Directory
  schließen) und &lt;tt class=&quot;sdoc-seg-c&quot;&gt;next()&lt;/tt&gt; (nächster Directory-Eintrag):
&lt;/p&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;sdoc-code-table&quot;&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 1&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;a name=&quot;package-Dirhandle&quot;&gt;&lt;/a&gt;&lt;span class=&quot;pt-k&quot;&gt;package &lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;Dirhandle&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 2&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 3&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;pt-w&quot;&gt;strict&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 4&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;pt-w&quot;&gt;warnings&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 5&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 6&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;a name=&quot;new&quot;&gt;&lt;/a&gt;&lt;span class=&quot;pt-k&quot;&gt;sub &lt;/span&gt;&lt;span class=&quot;pt-m&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;{&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 7&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;    &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;$class&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;$dir&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt; = &lt;span class=&quot;pt-i&quot;&gt;@_&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 8&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 9&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;    &lt;span class=&quot;pt-k&quot;&gt;opendir&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$dh&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;$dir&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;die&lt;/span&gt; &lt;span class=&quot;pt-q&quot;&gt;&amp;quot;ERROR: opendir failed: $dir ($!)\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;10&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;    &lt;span class=&quot;pt-k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;bless&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$dh&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;$class&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;11&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-s&quot;&gt;}&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;12&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;13&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;a name=&quot;close&quot;&gt;&lt;/a&gt;&lt;span class=&quot;pt-k&quot;&gt;sub &lt;/span&gt;&lt;span class=&quot;pt-m&quot;&gt;close&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;{&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;14&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;    &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$self&lt;/span&gt; = &lt;span class=&quot;pt-k&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;15&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;16&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;    &lt;span class=&quot;pt-k&quot;&gt;closedir&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$self&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;die&lt;/span&gt; &lt;span class=&quot;pt-q&quot;&gt;&amp;quot;ERROR: closedir failed ($!)\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;17&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;    &lt;span class=&quot;pt-k&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;18&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-s&quot;&gt;}&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;19&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;20&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;a name=&quot;next&quot;&gt;&lt;/a&gt;&lt;span class=&quot;pt-k&quot;&gt;sub &lt;/span&gt;&lt;span class=&quot;pt-m&quot;&gt;next&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;{&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;21&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;    &lt;span class=&quot;pt-k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;readdir&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;22&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-s&quot;&gt;}&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;23&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;24&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-n&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;25&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;26&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-c&quot;&gt;# eof&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  &lt;b class=&quot;sdoc-seg-b&quot;&gt;Beispiel:&lt;/b&gt; Gib alle Einträge des Verzeichnisses &lt;tt class=&quot;sdoc-seg-c&quot;&gt;$dir&lt;/tt&gt; auf
  &lt;tt class=&quot;sdoc-seg-c&quot;&gt;STDOUT&lt;/tt&gt; aus
&lt;/p&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 1&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;pt-w&quot;&gt;Dirhandle&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 2&lt;/span&gt; &amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 3&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$dh&lt;/span&gt; = &lt;span class=&quot;pt-w&quot;&gt;Dirhandle&lt;/span&gt;&lt;span class=&quot;pt-w&quot;&gt;-&amp;gt;new&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;$dir&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 4&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$entry&lt;/span&gt; = &lt;span class=&quot;pt-i&quot;&gt;$dh&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;-&amp;gt;next&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;{&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 5&lt;/span&gt;     &lt;span class=&quot;pt-k&quot;&gt;say&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$entry&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 6&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;}&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 7&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$dh&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;-&amp;gt;close&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;/pre&gt;
&lt;/div&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Das Dirhandle-Objekt &lt;tt class=&quot;sdoc-seg-c&quot;&gt;$dh&lt;/tt&gt; kann wie jede normale Dirhandle an
  die Perl-Builtins &lt;tt class=&quot;sdoc-seg-c&quot;&gt;readdir()&lt;/tt&gt;, &lt;tt class=&quot;sdoc-seg-c&quot;&gt;telldir()&lt;/tt&gt;,  &lt;tt class=&quot;sdoc-seg-c&quot;&gt;seekdir()&lt;/tt&gt;,
  &lt;tt class=&quot;sdoc-seg-c&quot;&gt;rewinddir()&lt;/tt&gt;,  &lt;tt class=&quot;sdoc-seg-c&quot;&gt;closedir()&lt;/tt&gt; übergeben werden.
&lt;/p&gt; 
    </content:encoded>

    <pubDate>Thu, 18 Mar 2010 22:41:26 +0100</pubDate>
    <guid isPermaLink="false">http://fseitz.de/blog/index.php?/archives/35-guid.html</guid>
    
</item>
<item>
    <title>Perl: Filehandles objektorientiert</title>
    <link>http://fseitz.de/blog/index.php?/archives/34-Perl-Filehandles-objektorientiert.html</link>
            <category>Perl</category>
    
    <comments>http://fseitz.de/blog/index.php?/archives/34-Perl-Filehandles-objektorientiert.html#comments</comments>
    <wfw:comment>http://fseitz.de/blog/wfwcomment.php?cid=34</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://fseitz.de/blog/rss.php?version=2.0&amp;type=comments&amp;cid=34</wfw:commentRss>
    

    <author>nospam@example.com (Frank Seitz)</author>
    <content:encoded>
    &lt;p class=&quot;sdoc-para-p&quot;&gt;
  Mit lexikalischen Filehandles ist es in Perl leicht möglich, File-I/O
  objektorientiert zu kapseln. Hier zur Veranschaulichung eine Klasse
  &lt;tt class=&quot;sdoc-seg-c&quot;&gt;Filehandle&lt;/tt&gt; mit drei Methoden: &lt;tt class=&quot;sdoc-seg-c&quot;&gt;new()&lt;/tt&gt; (Datei öffnen), &lt;tt class=&quot;sdoc-seg-c&quot;&gt;close()&lt;/tt&gt;
  (Datei schließen) und &lt;tt class=&quot;sdoc-seg-c&quot;&gt;slurp()&lt;/tt&gt; (Datei komplett einlesen):
&lt;/p&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;sdoc-code-table&quot;&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 1&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;a name=&quot;package-Filehandle&quot;&gt;&lt;/a&gt;&lt;span class=&quot;pt-k&quot;&gt;package &lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;Filehandle&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 2&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 3&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;pt-w&quot;&gt;strict&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 4&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;pt-w&quot;&gt;warnings&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 5&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 6&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;a name=&quot;new&quot;&gt;&lt;/a&gt;&lt;span class=&quot;pt-k&quot;&gt;sub &lt;/span&gt;&lt;span class=&quot;pt-m&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;{&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 7&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;    &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;$class&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;$mode&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;$file&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt; = &lt;span class=&quot;pt-i&quot;&gt;@_&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 8&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 9&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;    &lt;span class=&quot;pt-k&quot;&gt;open&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$fh&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;$mode&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;$file&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;die&lt;/span&gt; &lt;span class=&quot;pt-q&quot;&gt;&amp;quot;ERROR: open failed: $file ($!)\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;10&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;    &lt;span class=&quot;pt-k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;bless&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$fh&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;$class&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;11&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-s&quot;&gt;}&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;12&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;13&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;a name=&quot;close&quot;&gt;&lt;/a&gt;&lt;span class=&quot;pt-k&quot;&gt;sub &lt;/span&gt;&lt;span class=&quot;pt-m&quot;&gt;close&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;{&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;14&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;    &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$self&lt;/span&gt; = &lt;span class=&quot;pt-k&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;15&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;16&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;    &lt;span class=&quot;pt-k&quot;&gt;close&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$self&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;die&lt;/span&gt; &lt;span class=&quot;pt-q&quot;&gt;&amp;quot;ERROR: close failed ($!)\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;17&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;    &lt;span class=&quot;pt-k&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;18&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-s&quot;&gt;}&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;19&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;20&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;a name=&quot;slurp&quot;&gt;&lt;/a&gt;&lt;span class=&quot;pt-k&quot;&gt;sub &lt;/span&gt;&lt;span class=&quot;pt-m&quot;&gt;slurp&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;{&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;21&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;    &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$self&lt;/span&gt; = &lt;span class=&quot;pt-k&quot;&gt;shift&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;22&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;23&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;    &lt;span class=&quot;pt-k&quot;&gt;local&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$/&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;24&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;    &lt;span class=&quot;pt-k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;scalar&lt;/span&gt; &lt;span class=&quot;pt-q&quot;&gt;&amp;lt;$self&amp;gt;&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;25&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-s&quot;&gt;}&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;26&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;27&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-n&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;28&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;29&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-c&quot;&gt;# eof&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  &lt;b class=&quot;sdoc-seg-b&quot;&gt;Beispiel:&lt;/b&gt; Lies eine Datei komplett ein und gib sie auf &lt;tt class=&quot;sdoc-seg-c&quot;&gt;STDOUT&lt;/tt&gt; aus
&lt;/p&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 1&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;pt-w&quot;&gt;Filehandle&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 2&lt;/span&gt; &amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 3&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$fh&lt;/span&gt; = &lt;span class=&quot;pt-w&quot;&gt;Filehandle&lt;/span&gt;&lt;span class=&quot;pt-w&quot;&gt;-&amp;gt;new&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pt-q&quot;&gt;&amp;#39;&amp;lt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;$file&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 4&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$fh&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;-&amp;gt;slurp&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 5&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$fh&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;-&amp;gt;close&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;/pre&gt;
&lt;/div&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  &lt;b class=&quot;sdoc-seg-b&quot;&gt;Der Clou:&lt;/b&gt; Die Filehandle &lt;tt class=&quot;sdoc-seg-c&quot;&gt;$fh&lt;/tt&gt; kann unabhängig von der Klasse wie
  jede andere Perl-Filehandle benutzt werden, z.B. mit dem
  Diamant-Operator &lt;tt class=&quot;sdoc-seg-c&quot;&gt;&amp;lt;&amp;gt;&lt;/tt&gt; oder jeder anderen Filehandle-Operation
  wie &lt;tt class=&quot;sdoc-seg-c&quot;&gt;read()&lt;/tt&gt;, &lt;tt class=&quot;sdoc-seg-c&quot;&gt;write()&lt;/tt&gt; usw. Obiges Programm lässt sich also auch so
  implementieren:
&lt;/p&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 1&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;pt-w&quot;&gt;Filehandle&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 2&lt;/span&gt; &amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 3&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$fh&lt;/span&gt; = &lt;span class=&quot;pt-w&quot;&gt;Filehandle&lt;/span&gt;&lt;span class=&quot;pt-w&quot;&gt;-&amp;gt;new&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pt-q&quot;&gt;&amp;#39;&amp;lt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;$file&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 4&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pt-q&quot;&gt;&amp;lt;$fh&amp;gt;&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;{&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 5&lt;/span&gt;     &lt;span class=&quot;pt-k&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 6&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;}&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 7&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$fh&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;-&amp;gt;close&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;/pre&gt;
&lt;/div&gt; 
    </content:encoded>

    <pubDate>Tue, 16 Mar 2010 13:57:38 +0100</pubDate>
    <guid isPermaLink="false">http://fseitz.de/blog/index.php?/archives/34-guid.html</guid>
    
</item>
<item>
    <title>Perl: Crash bei Umleitung von STDERR auf Skalare Variable</title>
    <link>http://fseitz.de/blog/index.php?/archives/33-Perl-Crash-bei-Umleitung-von-STDERR-auf-Skalare-Variable.html</link>
            <category>Perl</category>
    
    <comments>http://fseitz.de/blog/index.php?/archives/33-Perl-Crash-bei-Umleitung-von-STDERR-auf-Skalare-Variable.html#comments</comments>
    <wfw:comment>http://fseitz.de/blog/wfwcomment.php?cid=33</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://fseitz.de/blog/rss.php?version=2.0&amp;type=comments&amp;cid=33</wfw:commentRss>
    

    <author>nospam@example.com (Frank Seitz)</author>
    <content:encoded>
    &lt;p class=&quot;sdoc-para-p&quot;&gt;
  Ich weiß nicht, wann Perl mir mal abgestürzt ist,
  aber jetzt bin ich auf einen Fall gestoßen:
&lt;/p&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;sdoc-code-table&quot;&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 1&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;#!/usr/bin/perl&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 2&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 3&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;pt-w&quot;&gt;strict&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 4&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;pt-w&quot;&gt;warnings&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 5&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 6&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$s&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 7&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-k&quot;&gt;close&lt;/span&gt; &lt;span class=&quot;pt-w&quot;&gt;STDERR&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 8&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-k&quot;&gt;open&lt;/span&gt; &lt;span class=&quot;pt-w&quot;&gt;STDERR&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-q&quot;&gt;&amp;#39;&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;\&lt;span class=&quot;pt-i&quot;&gt;$s&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;die&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt; 9&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-k&quot;&gt;warn&lt;/span&gt; &lt;span class=&quot;pt-q&quot;&gt;&amp;quot;a\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;10&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-i&quot;&gt;$s&lt;/span&gt; =~ &lt;span class=&quot;pt-q&quot;&gt;s/./xx/g&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-odd&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;11&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-code-tr-even&quot;&gt;
  &lt;td class=&quot;sdoc-code-td-ln&quot;&gt;12&lt;/td&gt;
  &lt;td class=&quot;sdoc-code-td-line&quot;&gt;&lt;span class=&quot;pt-c&quot;&gt;# eof&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;$ ./test.pl&amp;#10;Segmentation fault&lt;/pre&gt;
&lt;/div&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Perl-Version (andere habe ich nicht probiert):
&lt;/p&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;$ perl -v&amp;#10;This is perl, v5.10.1 (*) built for i686-linux&lt;/pre&gt;
&lt;/div&gt;
&lt;h1 class=&quot;sdoc-sec-h1&quot;&gt;Variationen&lt;/h1&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Wenn &lt;tt class=&quot;sdoc-seg-c&quot;&gt;$s&lt;/tt&gt; kein In-Memory File ist, geht es.
&lt;/p&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Bei &lt;tt class=&quot;sdoc-seg-c&quot;&gt;$s =~ s/./xx/;&lt;/tt&gt; geht es (ohne g Modifier).
&lt;/p&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Bei &lt;tt class=&quot;sdoc-seg-c&quot;&gt;$s =~ s/./x/g;&lt;/tt&gt; geht es (der String wird nicht länger).
&lt;/p&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Schließen von &lt;tt class=&quot;sdoc-seg-c&quot;&gt;STDERR&lt;/tt&gt; vor dem &lt;tt class=&quot;sdoc-seg-c&quot;&gt;s///&lt;/tt&gt; ändert nichts.
&lt;/p&gt; 
    </content:encoded>

    <pubDate>Fri, 05 Mar 2010 09:56:59 +0100</pubDate>
    <guid isPermaLink="false">http://fseitz.de/blog/index.php?/archives/33-guid.html</guid>
    
</item>
<item>
    <title>Syntax-Highlighting mit perltidy</title>
    <link>http://fseitz.de/blog/index.php?/archives/29-Syntax-Highlighting-mit-perltidy.html</link>
            <category>Perl</category>
    
    <comments>http://fseitz.de/blog/index.php?/archives/29-Syntax-Highlighting-mit-perltidy.html#comments</comments>
    <wfw:comment>http://fseitz.de/blog/wfwcomment.php?cid=29</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://fseitz.de/blog/rss.php?version=2.0&amp;type=comments&amp;cid=29</wfw:commentRss>
    

    <author>nospam@example.com (Frank Seitz)</author>
    <content:encoded>
    &lt;p class=&quot;sdoc-para-p&quot;&gt;
  Perltidy stellt die Syntax von Perl-Code farbig und mit
  Fontattributen wie kursiv und fett dar, wenn man den Code mit Option
  &lt;tt class=&quot;sdoc-seg-c&quot;&gt;-html&lt;/tt&gt; nach HTML wandelt. Ich nutze dieses Feature, um lesbareren
  Perl-Code für mein Blog zu generieren.
&lt;/p&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Für die Einbettung des generierten HTML-Codes in eigene HTML-Seiten
  sind allerdings kleinere Sonderbehandlungen nötig.
&lt;/p&gt;
&lt;h1 class=&quot;sdoc-sec-h1&quot;&gt;Anpassung der Stylesheet-Definitionen&lt;/h1&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Perltidy generiert mit
&lt;/p&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;$ perltidy -html -ss &amp;gt;FILE.css&lt;/pre&gt;
&lt;/div&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  eine Stylesheet-Datei, die die Definitionen der CSS-Klassen für die
  Syntaxelemente enthält und in die eigenen HTML-Seiten
  eingebunden werden kann:
&lt;/p&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;&lt;span class=&quot;hl com&quot;&gt;/* default style sheet generated by perltidy */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwb&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl kwa&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#FFFFFF&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#000000&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;}&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwb&quot;&gt;pre&lt;/span&gt; &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#000000&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;&lt;/span&gt;&amp;#10;      &lt;span class=&quot;hl kwa&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#FFFFFF&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;&lt;/span&gt;&amp;#10;      &lt;span class=&quot;hl kwa&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; courier&lt;span class=&quot;hl sym&quot;&gt;;&lt;/span&gt;&amp;#10;    &lt;span class=&quot;hl sym&quot;&gt;}&lt;/span&gt;&amp;#10;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.c&lt;/span&gt;  &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#228B22&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* comment */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.cm&lt;/span&gt; &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#000000&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* comma */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.co&lt;/span&gt; &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#000000&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* colon */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.h&lt;/span&gt;  &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#CD5555&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl kwa&quot;&gt;bold&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* here-doc-target */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.hh&lt;/span&gt; &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#CD5555&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;font-style&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl kwa&quot;&gt;italic&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* here-doc-text */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.i&lt;/span&gt;  &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#00688B&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* identifier */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.j&lt;/span&gt;  &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#CD5555&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl kwa&quot;&gt;bold&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* label */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.k&lt;/span&gt;  &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#8B008B&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl kwa&quot;&gt;bold&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* keyword */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.m&lt;/span&gt;  &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#FF0000&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl kwa&quot;&gt;bold&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* subroutine */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.n&lt;/span&gt;  &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#B452CD&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* numeric */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.p&lt;/span&gt;  &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#000000&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* paren */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.pd&lt;/span&gt; &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#228B22&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;font-style&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl kwa&quot;&gt;italic&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* pod-text */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.pu&lt;/span&gt; &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#000000&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* punctuation */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.q&lt;/span&gt;  &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#CD5555&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* quote */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.s&lt;/span&gt;  &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#000000&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* structure */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.sc&lt;/span&gt; &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#000000&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* semicolon */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.v&lt;/span&gt;  &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#B452CD&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* v-string */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.w&lt;/span&gt;  &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#000000&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* bareword */&lt;/span&gt;&amp;#10;&lt;/pre&gt;
&lt;/div&gt;
&lt;h1 class=&quot;sdoc-sec-h1&quot;&gt;Anpassung 1&lt;/h1&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Die CSS-Definitionen für &lt;tt class=&quot;sdoc-seg-c&quot;&gt;&amp;lt;body&amp;gt;&lt;/tt&gt; und &lt;tt class=&quot;sdoc-seg-c&quot;&gt;&amp;lt;pre&amp;gt;&lt;/tt&gt; am Anfang sollten im
  Falle einer Einbettung nicht vorkommen, da diese an anderer
  Stelle definiert sind. Sie lassen sich mit &lt;tt class=&quot;sdoc-seg-c&quot;&gt;grep&lt;/tt&gt; wegfiltern.
&lt;/p&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;$ perltidy -html -ss | grep &#039;^\.&#039;&lt;/pre&gt;
&lt;/div&gt;
&lt;h1 class=&quot;sdoc-sec-h1&quot;&gt;Anpassung 2&lt;/h1&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Die Namen der CSS-Klassen bestehen aus ein oder zwei
  Buchstaben, was zu Nameclashes führen kann.
  Dies verbessere ich, indem ich dem Klassennamen
  einen Präfix voranstelle. Ich wähle &quot;pt-&quot;.
&lt;/p&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;$ perltidy -html -ss | grep &#039;^\.&#039; | sed -e &#039;s/^\./.pt-/&#039;&lt;/pre&gt;
&lt;/div&gt;
&lt;h1 class=&quot;sdoc-sec-h1&quot;&gt;Resultierende CSS-Datei&lt;/h1&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;&lt;span class=&quot;hl kwc&quot;&gt;.pt-c&lt;/span&gt;  &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#228B22&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* comment */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.pt-cm&lt;/span&gt; &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#000000&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* comma */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.pt-co&lt;/span&gt; &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#000000&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* colon */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.pt-h&lt;/span&gt;  &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#CD5555&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl kwa&quot;&gt;bold&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* here-doc-target */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.pt-hh&lt;/span&gt; &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#CD5555&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;font-style&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl kwa&quot;&gt;italic&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* here-doc-text */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.pt-i&lt;/span&gt;  &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#00688B&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* identifier */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.pt-j&lt;/span&gt;  &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#CD5555&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl kwa&quot;&gt;bold&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* label */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.pt-k&lt;/span&gt;  &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#8B008B&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl kwa&quot;&gt;bold&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* keyword */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.pt-m&lt;/span&gt;  &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#FF0000&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl kwa&quot;&gt;bold&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* subroutine */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.pt-n&lt;/span&gt;  &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#B452CD&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* numeric */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.pt-p&lt;/span&gt;  &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#000000&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* paren */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.pt-pd&lt;/span&gt; &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#228B22&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;font-style&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;hl kwa&quot;&gt;italic&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* pod-text */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.pt-pu&lt;/span&gt; &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#000000&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* punctuation */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.pt-q&lt;/span&gt;  &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#CD5555&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* quote */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.pt-s&lt;/span&gt;  &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#000000&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* structure */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.pt-sc&lt;/span&gt; &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#000000&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* semicolon */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.pt-v&lt;/span&gt;  &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#B452CD&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* v-string */&lt;/span&gt;&amp;#10;&lt;span class=&quot;hl kwc&quot;&gt;.pt-w&lt;/span&gt;  &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;#000000&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;hl com&quot;&gt;/* bareword */&lt;/span&gt;&amp;#10;&lt;/pre&gt;
&lt;/div&gt;
&lt;h1 class=&quot;sdoc-sec-h1&quot;&gt;Anpassung des HTML-Codes&lt;/h1&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Perltidy erzeugt mit
&lt;/p&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;$ perltidy -html -pre &amp;lt;FILE &amp;gt;FILE.html&lt;/pre&gt;
&lt;/div&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  eine Quelltext-Darstellung in HTML. Diese kann in die eigene
  Seite eingebunden werden.
&lt;/p&gt;
&lt;h1 class=&quot;sdoc-sec-h1&quot;&gt;Anpassung 1&lt;/h1&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Der HTML-Code ist in ein &lt;tt class=&quot;sdoc-seg-c&quot;&gt;&amp;lt;pre&amp;gt;&lt;/tt&gt; ohne Klassenanabe eingefasst.  Das
  CSS-Layout dieses &lt;tt class=&quot;sdoc-seg-c&quot;&gt;&amp;lt;pre&amp;gt;&lt;/tt&gt; lässt sich also nicht gezielt anpassen. Am
  besten filtert man es weg und setzt den HTML-Code in ein eigenes
  &lt;tt class=&quot;sdoc-seg-c&quot;&gt;&amp;lt;pre&amp;gt;&lt;/tt&gt;.
&lt;/p&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;$ perltidy -html -pre &amp;lt;FILE | egrep -v &#039;^&amp;lt;/?pre&amp;gt;&#039;&lt;/pre&gt;
&lt;/div&gt;
&lt;h1 class=&quot;sdoc-sec-h1&quot;&gt;Anpassung 2&lt;/h1&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Die CSS-Klassennamen müssen an die oben gewählten Namen in der
  Stylesheet-Datei angepasst werden.
&lt;/p&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;$ perltidy -html -pre | egrep -v &#039;^&amp;lt;/?pre&amp;gt;&#039; | sed -e &#039;s/class=&quot;/class=&quot;pt-/g&#039;&lt;/pre&gt;
&lt;/div&gt;
&lt;h1 class=&quot;sdoc-sec-h1&quot;&gt;Resultierender HTML-Code&lt;/h1&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Aus
&lt;/p&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;print &quot;Hello world!\n&quot;;&lt;/pre&gt;
&lt;/div&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  wird im HTML-Output (Umbruch hinzugefügt)
&lt;/p&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;&amp;lt;span class=&quot;pt-k&quot;&amp;gt;print&amp;lt;/span&amp;gt; &amp;lt;span class=&quot;pt-q&quot;&amp;gt;&amp;#10;  &amp;amp;quot;Hello world!\n&amp;amp;quot;&amp;lt;/span&amp;gt;&amp;lt;span class=&quot;pt-sc&quot;&amp;gt;;&amp;lt;/span&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  und im Browser
&lt;/p&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;&lt;span class=&quot;pt-k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;pt-q&quot;&gt;&amp;quot;Hello world!\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;/pre&gt;
&lt;/div&gt; 
    </content:encoded>

    <pubDate>Fri, 05 Feb 2010 18:45:03 +0100</pubDate>
    <guid isPermaLink="false">http://fseitz.de/blog/index.php?/archives/29-guid.html</guid>
    
</item>
<item>
    <title>Perl: Effizient Zeichen zählen</title>
    <link>http://fseitz.de/blog/index.php?/archives/28-Perl-Effizient-Zeichen-zaehlen.html</link>
            <category>Perl</category>
    
    <comments>http://fseitz.de/blog/index.php?/archives/28-Perl-Effizient-Zeichen-zaehlen.html#comments</comments>
    <wfw:comment>http://fseitz.de/blog/wfwcomment.php?cid=28</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://fseitz.de/blog/rss.php?version=2.0&amp;type=comments&amp;cid=28</wfw:commentRss>
    

    <author>nospam@example.com (Frank Seitz)</author>
    <content:encoded>
    &lt;p class=&quot;sdoc-para-p&quot;&gt;
  Ist eine FAQ (s. &lt;tt class=&quot;sdoc-seg-c&quot;&gt;perldoc -q occurrences&lt;/tt&gt;), aber ich vergesse
  immer die genaue Syntax, da ich &lt;tt class=&quot;sdoc-seg-c&quot;&gt;tr///&lt;/tt&gt; selten nutze und es mehrere
  Funktionen in sich vereint:
&lt;/p&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;&lt;span class=&quot;pt-i&quot;&gt;$n&lt;/span&gt; = &lt;span class=&quot;pt-i&quot;&gt;$str&lt;/span&gt; =~ &lt;span class=&quot;pt-q&quot;&gt;tr/\n//&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;/pre&gt;
&lt;/div&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  &lt;tt class=&quot;sdoc-seg-c&quot;&gt;$n&lt;/tt&gt; ist in diesem Fall die Anzahl der Zeilenumbrüche in &lt;tt class=&quot;sdoc-seg-c&quot;&gt;$str&lt;/tt&gt;.
&lt;/p&gt; 
    </content:encoded>

    <pubDate>Fri, 05 Feb 2010 12:06:45 +0100</pubDate>
    <guid isPermaLink="false">http://fseitz.de/blog/index.php?/archives/28-guid.html</guid>
    
</item>
<item>
    <title>Perl: Gleitkomma-Zahlen ausgeben wie sie sind</title>
    <link>http://fseitz.de/blog/index.php?/archives/24-Perl-Gleitkomma-Zahlen-ausgeben-wie-sie-sind.html</link>
            <category>Perl</category>
    
    <comments>http://fseitz.de/blog/index.php?/archives/24-Perl-Gleitkomma-Zahlen-ausgeben-wie-sie-sind.html#comments</comments>
    <wfw:comment>http://fseitz.de/blog/wfwcomment.php?cid=24</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://fseitz.de/blog/rss.php?version=2.0&amp;type=comments&amp;cid=24</wfw:commentRss>
    

    <author>nospam@example.com (Frank Seitz)</author>
    <content:encoded>
    &lt;p&gt;
Vielleicht trivial, aber mir war die Antwort bislang nicht klar: Wie gebe ich
eine Gleitkomma-Zahl aus, ohne dass Stellen wegfallen oder überflüssige Nullen am Ende erscheinen?
&lt;/p&gt;

&lt;p&gt;
Bei der Ausgabe von Gleitkommazahlen habe ich bislang automatisch zu printf/sprintf
und %f gegriffen, aber das Format-Element %f formatiert die Zahlen ja immer auf
eine feste Anzahl an Stellen und rundet auf die letzte Stelle. Z.B.
&lt;/p&gt;

&lt;pre class=&quot;s-pre-box&quot;&gt;
my $x = 0.123456789;
printf &quot;%f&quot;,$x;
&lt;/pre&gt;

&lt;p&gt;
ergibt
&lt;/p&gt;

&lt;pre class=&quot;s-pre-box&quot;&gt;
0.123457
&lt;/pre&gt;

&lt;p&gt;
(%f formatiert/rundet per Default auf 6 Nachkommastellen)
&lt;/p&gt;

&lt;p&gt;
Natürlich kann ich die Anzahl der Stellen groß wählen, aber dann bekomme
ich u.U. zusätzliche Stellen, wenn die betreffende Zahl binär nur
näherungsweise dargestellt werden kann:
&lt;/p&gt;

&lt;pre class=&quot;s-pre-box&quot;&gt;
my $x = 0.123456789;
printf &quot;%.20f&quot;,$x;
&lt;/pre&gt;

&lt;p&gt;
ergibt
&lt;/p&gt;

&lt;pre class=&quot;s-pre-box&quot;&gt;
0.12345678899999999734
&lt;/pre&gt;

&lt;p&gt;
Andererseits erhalte ich am Ende überflüssige Nullen bei Zahlen,
die dezimal weniger als die vorgegebenen Stellen besitzen:
&lt;/p&gt;

&lt;pre class=&quot;s-pre-box&quot;&gt;
my $x = 0.5;
printf &quot;%.20f&quot;,$x;
&lt;/pre&gt;

&lt;p&gt;
ergibt
&lt;/p&gt;

&lt;pre class=&quot;s-pre-box&quot;&gt;
0.50000000000000000000
&lt;/pre&gt;

&lt;p&gt;
Was tun?
&lt;/p&gt;

&lt;p&gt;
Die Lösung ist (anscheinend) einfach: Ich gebe die Zahl nicht als Zahl sondern als &lt;i&gt;String&lt;/i&gt; aus!
D.h. im Falle von printf/sprintf mit Format-Element %s!
&lt;/p&gt;

&lt;p&gt;
Damit erhalte ich, was ich will. Die Zahl mit allen Stellen und nicht mehr
&lt;/p&gt;

&lt;pre class=&quot;s-pre-box&quot;&gt;
my $x = 0.123456789;
printf &quot;%s&quot;,$x;
&lt;/pre&gt;

&lt;pre class=&quot;s-pre-box&quot;&gt;
0.123456789
&lt;/pre&gt;

&lt;p&gt;
und ohne überflüssige Nullen
&lt;/p&gt;

&lt;pre class=&quot;s-pre-box&quot;&gt;
my $x = 0.5;
printf &quot;%s&quot;,$x;
&lt;/pre&gt;

&lt;pre class=&quot;s-pre-box&quot;&gt;
0.5
&lt;/pre&gt;

&lt;p&gt;
Bei näherer Überlegung leuchtet das ein, da Perl intern neben der (binären) numerischen
Repräsentation eine Stringrepräsentation des Werts speichert, welche anfänglich
genau der Zeichenfolge bei der Zuweisung entspricht.
&lt;/p&gt;

&lt;p&gt;
Schlussfolgerung: Programme, die nicht rechnen, sondern Gleitkommazahlen
nur einlesen und wieder ausgeben, sollten, um Verfälschungen auszuschließen,
diese bei der Ausgabe grundsätzlich als Strings und nicht als Zahlen behandeln.
&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Wed, 27 Jan 2010 11:13:40 +0100</pubDate>
    <guid isPermaLink="false">http://fseitz.de/blog/index.php?/archives/24-guid.html</guid>
    
</item>
<item>
    <title>Perl-Operationen auf Symlinks</title>
    <link>http://fseitz.de/blog/index.php?/archives/17-Perl-Operationen-auf-Symlinks.html</link>
            <category>Perl</category>
    
    <comments>http://fseitz.de/blog/index.php?/archives/17-Perl-Operationen-auf-Symlinks.html#comments</comments>
    <wfw:comment>http://fseitz.de/blog/wfwcomment.php?cid=17</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://fseitz.de/blog/rss.php?version=2.0&amp;type=comments&amp;cid=17</wfw:commentRss>
    

    <author>nospam@example.com (Frank Seitz)</author>
    <content:encoded>
    &lt;p&gt;
Für den Umgang mit Symlinks stellt Perl eine Reihe von Builtins zur Verfügung,
die nicht unbedingt offensichtlich sind. Hier eine kurze Übersicht:
&lt;/p&gt;

&lt;dl&gt;
  &lt;dt&gt;&lt;code&gt;$bool = -l $path&lt;/code&gt;&lt;/dt&gt;
  &lt;dd&gt;Test auf Symlink.&lt;/dd&gt;
  &lt;dt&gt;&lt;code&gt;@stat = lstat $path&lt;/code&gt;&lt;/dt&gt;
  &lt;dd&gt;Dateisystem-Eigenschaften des Symlink.&lt;/dd&gt;
  &lt;dt&gt;&lt;code&gt;$destPath = readlink $path&lt;/code&gt;&lt;/dt&gt;
  &lt;dd&gt;Ziel des Symlink.&lt;/dd&gt;
  &lt;dt&gt;&lt;code&gt;$bool = symlink $path,$destPath&lt;/code&gt;&lt;/dt&gt;
  &lt;dd&gt;Erstelle Symlink $path mit Ziel $destPath. Liefert 0 im Fehlerfall.&lt;/dd&gt;
&lt;/dl&gt; 
    </content:encoded>

    <pubDate>Wed, 20 Jan 2010 11:15:34 +0100</pubDate>
    <guid isPermaLink="false">http://fseitz.de/blog/index.php?/archives/17-guid.html</guid>
    
</item>
<item>
    <title>Liste der zusätzlich installierten Perl-Module</title>
    <link>http://fseitz.de/blog/index.php?/archives/16-Liste-der-zusaetzlich-installierten-Perl-Module.html</link>
            <category>Perl</category>
    
    <comments>http://fseitz.de/blog/index.php?/archives/16-Liste-der-zusaetzlich-installierten-Perl-Module.html#comments</comments>
    <wfw:comment>http://fseitz.de/blog/wfwcomment.php?cid=16</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://fseitz.de/blog/rss.php?version=2.0&amp;type=comments&amp;cid=16</wfw:commentRss>
    

    <author>nospam@example.com (Frank Seitz)</author>
    <content:encoded>
    &lt;p class=&quot;sdoc-para-p&quot;&gt;
  Wie ermittele ich, welche Perl-Module über das Grundsystem hinaus
  installiert wurden?
&lt;/p&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Die Antwort liefert das Kommando:
&lt;/p&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;$ perldoc perllocal&lt;/pre&gt;
&lt;/div&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Das Ergebnis ist ein formatiertes POD-Dokument, das die
  Installationshistorie aller per &lt;tt class=&quot;sdoc-seg-c&quot;&gt;make install&lt;/tt&gt; oder
  &lt;tt class=&quot;sdoc-seg-c&quot;&gt;./Build install&lt;/tt&gt; installierten Module aufführt.
&lt;/p&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Das Dokument wird mit der Installation des ersten Moduls
  angelegt. Unmittelbar nach Installation des Core-Systems ist es noch
  nicht vorhanden, da noch kein zusätzliches Modul installiert wurde.
&lt;/p&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Mit jeder Modul-Installation wird ein Eintrag am Ende hinzugefügt.
  Wird ein Modul mehrfach installiert, taucht es mehrfach auf.
&lt;/p&gt;
&lt;h1 class=&quot;sdoc-sec-h1&quot;&gt;Programm&lt;/h1&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Liefere die Namen der zusätzlich installierten Module, alphabetisch
  sortiert, ohne Doubletten:
&lt;/p&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 1&lt;/span&gt; #!/usr/bin/env perl&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 2&lt;/span&gt; &amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 3&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;pt-w&quot;&gt;strict&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 4&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;pt-w&quot;&gt;warnings&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 5&lt;/span&gt; &amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 6&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;%mod&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 7&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$cmd&lt;/span&gt; = &lt;span class=&quot;pt-q&quot;&gt;&amp;#39;perldoc -u perllocal&amp;#39;&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 8&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$fh&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-q&quot;&gt;&amp;#39;-|&amp;#39;&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;$cmd&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;die&lt;/span&gt; &lt;span class=&quot;pt-q&quot;&gt;&amp;quot;ERROR: open failed ($!)&amp;quot;&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 9&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pt-q&quot;&gt;&amp;lt;$fh&amp;gt;&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;{&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;10&lt;/span&gt;     &lt;span class=&quot;pt-k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pt-q&quot;&gt;/^=head2.*\|(.*)&amp;gt;/&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;{&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;11&lt;/span&gt;         &lt;span class=&quot;pt-i&quot;&gt;$mod&lt;/span&gt;{&lt;span class=&quot;pt-i&quot;&gt;$1&lt;/span&gt;} = &lt;span class=&quot;pt-n&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;12&lt;/span&gt;     &lt;span class=&quot;pt-s&quot;&gt;}&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;13&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;}&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;14&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;close&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;$fh&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;die&lt;/span&gt; &lt;span class=&quot;pt-q&quot;&gt;qq|ERROR: Command failed: &amp;quot;$cmd&amp;quot; (Exit Code: $?)\n|&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;15&lt;/span&gt; &amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;16&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$mod&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pt-k&quot;&gt;sort&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;keys&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;%mod&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;{&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;17&lt;/span&gt;     &lt;span class=&quot;pt-k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;pt-q&quot;&gt;&amp;quot;$mod\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;18&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;}&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;19&lt;/span&gt; &amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;20&lt;/span&gt; &lt;span class=&quot;pt-c&quot;&gt;# eof&lt;/span&gt;&amp;#10;&lt;/pre&gt;
&lt;/div&gt; 
    </content:encoded>

    <pubDate>Tue, 19 Jan 2010 21:43:28 +0100</pubDate>
    <guid isPermaLink="false">http://fseitz.de/blog/index.php?/archives/16-guid.html</guid>
    
</item>
<item>
    <title>Speicherbedarf von Perl-Variablen</title>
    <link>http://fseitz.de/blog/index.php?/archives/11-Speicherbedarf-von-Perl-Variablen.html</link>
            <category>Perl</category>
    
    <comments>http://fseitz.de/blog/index.php?/archives/11-Speicherbedarf-von-Perl-Variablen.html#comments</comments>
    <wfw:comment>http://fseitz.de/blog/wfwcomment.php?cid=11</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://fseitz.de/blog/rss.php?version=2.0&amp;type=comments&amp;cid=11</wfw:commentRss>
    

    <author>nospam@example.com (Frank Seitz)</author>
    <content:encoded>
    &lt;p class=&quot;sdoc-para-p&quot;&gt;
  Der Speicherbedarf von einzelnen Perl-Variablen und komplexeren
  Datenstrukturen lässt sich mit
  &lt;a class=&quot;sdoc-seg-u&quot; href=&quot;http://search.cpan.org/~tels/Devel-Size/&quot;&gt;Devel::Size&lt;/a&gt;
  ermitteln. Hier die Werte für Perl 5.10 auf einem 32-Bit System.
&lt;/p&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  (Eine andere Betrachtung - Messung des verbrauchten virtuellen
  Speichers bei großen Datenstrukturen - hat Peter J. Holzer angestellt:
  &lt;a class=&quot;sdoc-seg-u&quot; href=&quot;http://www.hjp.at/programming/perl/memory/&quot;&gt;http://www.hjp.at/programming/perl/memory/&lt;/a&gt;)
&lt;/p&gt;
&lt;h1 class=&quot;sdoc-sec-h1&quot;&gt;Skalare&lt;/h1&gt;
&lt;table class=&quot;sdoc-tab-table&quot;&gt;
&lt;tr class=&quot;sdoc-tab-tr-odd&quot;&gt;
  &lt;th class=&quot;sdoc-tab-th&quot; align=&quot;left&quot;&gt;Skalar ohne Wert:&lt;/th&gt;
  &lt;td class=&quot;sdoc-tab-td&quot; align=&quot;left&quot;&gt;16 Bytes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-tab-tr-even&quot;&gt;
  &lt;th class=&quot;sdoc-tab-th&quot; align=&quot;left&quot;&gt;Referenz:&lt;/th&gt;
  &lt;td class=&quot;sdoc-tab-td&quot; align=&quot;left&quot;&gt;16 Bytes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-tab-tr-odd&quot;&gt;
  &lt;th class=&quot;sdoc-tab-th&quot; align=&quot;left&quot;&gt;Integer:&lt;/th&gt;
  &lt;td class=&quot;sdoc-tab-td&quot; align=&quot;left&quot;&gt;16 Bytes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-tab-tr-even&quot;&gt;
  &lt;th class=&quot;sdoc-tab-th&quot; align=&quot;left&quot;&gt;Float:&lt;/th&gt;
  &lt;td class=&quot;sdoc-tab-td&quot; align=&quot;left&quot;&gt;24 Bytes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-tab-tr-odd&quot;&gt;
  &lt;th class=&quot;sdoc-tab-th&quot; align=&quot;left&quot;&gt;Leerstring:&lt;/th&gt;
  &lt;td class=&quot;sdoc-tab-td&quot; align=&quot;left&quot;&gt;36 Bytes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-tab-tr-even&quot;&gt;
  &lt;th class=&quot;sdoc-tab-th&quot; align=&quot;left&quot;&gt;String der Länge n:&lt;/th&gt;
  &lt;td class=&quot;sdoc-tab-td&quot; align=&quot;left&quot;&gt;36+n Bytes&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Perl alloziert bei Strings jeweils 4 Bytes im Voraus, vermutlich um
  jedes UTF-8 Zeichen speichern zu können. Obige Berechnung geht von
  1-Byte-Zeichen aus. Enthält der String UTF-8 Zeichen mit 2, 3 oder 4
  Byte, vergrößert sich der Platzbedarf entsprechend.
&lt;/p&gt;
&lt;h1 class=&quot;sdoc-sec-h1&quot;&gt;Arrays&lt;/h1&gt;
&lt;table class=&quot;sdoc-tab-table&quot;&gt;
&lt;tr class=&quot;sdoc-tab-tr-odd&quot;&gt;
  &lt;th class=&quot;sdoc-tab-th&quot; align=&quot;left&quot;&gt;leeres Array:&lt;/th&gt;
  &lt;td class=&quot;sdoc-tab-td&quot; align=&quot;left&quot;&gt;100 Bytes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-tab-tr-even&quot;&gt;
  &lt;th class=&quot;sdoc-tab-th&quot; align=&quot;left&quot;&gt;Array der Größe n:&lt;/th&gt;
  &lt;td class=&quot;sdoc-tab-td&quot; align=&quot;left&quot;&gt;100+4*n Bytes&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Perl vergrößert ein Array schrittweise auf 4, 8, 16, 32, 64,
  ... Elemente. D.h. wird das 4. Element zugewiesen, vergößert Perl
  intern schon auf 8 Elemente usw. Für jedes Element alloziert Perl
  einen Pointer (4 Bytes). Die angegebene Größe ist der
  &lt;i class=&quot;sdoc-seg-i&quot;&gt;Netto&lt;/i&gt;-Speicherbedarf des Array, d.h. der Speicherbedarf der
  (skalaren) Werte kommt noch hinzu.
&lt;/p&gt;
&lt;h1 class=&quot;sdoc-sec-h1&quot;&gt;Hashes&lt;/h1&gt;
&lt;table class=&quot;sdoc-tab-table&quot;&gt;
&lt;tr class=&quot;sdoc-tab-tr-odd&quot;&gt;
  &lt;th class=&quot;sdoc-tab-th&quot; align=&quot;left&quot;&gt;leerer Hash:&lt;/th&gt;
  &lt;td class=&quot;sdoc-tab-td&quot; align=&quot;left&quot;&gt;76 Bytes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class=&quot;sdoc-tab-tr-even&quot;&gt;
  &lt;th class=&quot;sdoc-tab-th&quot; align=&quot;left&quot;&gt;Hash mit n Keys:&lt;/th&gt;
  &lt;td class=&quot;sdoc-tab-td&quot; align=&quot;left&quot;&gt;ungefähr 76+n*4+n*(durchschn. Keygröße+8+Anz. Buckets)&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Perl vergrößert einen Hash schrittweise auf 8, 16, 32, 64,
  ... Elemente. D.h. wird das 8. Element zugewiesen, vergößert Perl
  intern auf 16 Elemente usw. Für jeden Key alloziert Perl vorab einen
  Pointer (4 Bytes). Zusätzlich kommt mit zunehmender Anzahl Buckets ein
  wachsender Overhead von 9, 10, 11, ... Bytes je Key hinzu. Die Größe
  des Key geht auch mit ein. Bei der Messung unten ist der Key der
  String &quot;EintragNNNN&quot;, also 11 Zeichen lang. Die angegebene Größe ist
  der &lt;i class=&quot;sdoc-seg-i&quot;&gt;Netto&lt;/i&gt;-Speicherbedarf des Hash, d.h. der Speicherbedarf der
  Werte kommt noch hinzu.
&lt;/p&gt;
&lt;h1 class=&quot;sdoc-sec-h1&quot;&gt;Messung&lt;/h1&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;Perl Version: 5.010000&amp;#10;Skalar ohne Wert: 16 Bytes&amp;#10;Referenz: 16 Bytes&amp;#10;Integer: 16 Bytes&amp;#10;Float: 24 Bytes&amp;#10;String - leer: 36 Bytes&amp;#10;String - 1 1-Byte Zeichen: 36 Bytes (Diff: 0)&amp;#10;String - 2 1-Byte Zeichen: 36 Bytes (Diff: 0)&amp;#10;String - 3 1-Byte Zeichen: 36 Bytes (Diff: 0)&amp;#10;String - 4 1-Byte Zeichen: 40 Bytes (Diff: 4)&amp;#10;String - 5 1-Byte Zeichen: 40 Bytes (Diff: 0)&amp;#10;String - 6 1-Byte Zeichen: 40 Bytes (Diff: 0)&amp;#10;String - 7 1-Byte Zeichen: 40 Bytes (Diff: 0)&amp;#10;String - 8 1-Byte Zeichen: 44 Bytes (Diff: 4)&amp;#10;String - 9 1-Byte Zeichen: 44 Bytes (Diff: 0)&amp;#10;String - 10 1-Byte Zeichen: 44 Bytes (Diff: 0)&amp;#10;String - 11 1-Byte Zeichen: 44 Bytes (Diff: 0)&amp;#10;String - 12 1-Byte Zeichen: 48 Bytes (Diff: 4)&amp;#10;String - 16 1-Byte Zeichen: 52 Bytes (Diff: 4)&amp;#10;String - 20 1-Byte Zeichen: 56 Bytes (Diff: 4)&amp;#10;Array - leer: 100 Bytes&amp;#10;Array - 4 Elemente: 116 Bytes (Diff: 16) - 29.0 Bytes/Key&amp;#10;Array - 8 Elemente: 148 Bytes (Diff: 32) - 18.5 Bytes/Key&amp;#10;Array - 16 Elemente: 212 Bytes (Diff: 64) - 13.2 Bytes/Key&amp;#10;Array - 32 Elemente: 340 Bytes (Diff: 128) - 10.6 Bytes/Key&amp;#10;Array - 64 Elemente: 596 Bytes (Diff: 256) - 9.3 Bytes/Key&amp;#10;Hash - leer: 76 Bytes&amp;#10;Hash - 4 Keys: 208 Bytes (Diff: 132) - 52.0 Bytes/Key&amp;#10;Hash - 8 Keys: 372 Bytes (Diff: 164) - 46.5 Bytes/Key&amp;#10;Hash - 16 Keys: 636 Bytes (Diff: 264) - 39.8 Bytes/Key&amp;#10;Hash - 32 Keys: 1228 Bytes (Diff: 592) - 38.4 Bytes/Key&amp;#10;Hash - 64 Keys: 2412 Bytes (Diff: 1184) - 37.7 Bytes/Key&amp;#10;Hash - 128 Keys: 4780 Bytes (Diff: 2368) - 37.3 Bytes/Key&amp;#10;Hash - 256 Keys: 10540 Bytes (Diff: 5760) - 41.2 Bytes/Key&amp;#10;Hash - 512 Keys: 18988 Bytes (Diff: 8448) - 37.1 Bytes/Key&amp;#10;Hash - 1024 Keys: 42028 Bytes (Diff: 23040) - 41.0 Bytes/Key&amp;#10;&lt;/pre&gt;
&lt;/div&gt;
&lt;h1 class=&quot;sdoc-sec-h1&quot;&gt;Programm&lt;/h1&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 1&lt;/span&gt; #!/usr/bin/env perl&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 2&lt;/span&gt; &amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 3&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;pt-w&quot;&gt;strict&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 4&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;pt-w&quot;&gt;warnings&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 5&lt;/span&gt; &amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 6&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;use&lt;/span&gt; &lt;span class=&quot;pt-w&quot;&gt;Devel::Size&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 7&lt;/span&gt; &amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 8&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;pt-q&quot;&gt;&amp;quot;Perl Version: $]\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt; 9&lt;/span&gt; &amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;10&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$s1&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;11&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;pt-q&quot;&gt;&amp;#39;Skalar ohne Wert: &amp;#39;&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;Devel::Size::size&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;\&lt;span class=&quot;pt-i&quot;&gt;$s1&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-q&quot;&gt;&amp;quot; Bytes\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;12&lt;/span&gt; &amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;13&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$s2&lt;/span&gt; = \&lt;span class=&quot;pt-i&quot;&gt;$s1&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;14&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;pt-q&quot;&gt;&amp;#39;Referenz: &amp;#39;&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;Devel::Size::size&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;\&lt;span class=&quot;pt-i&quot;&gt;$s2&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-q&quot;&gt;&amp;quot; Bytes\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;15&lt;/span&gt; &amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;16&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$s3&lt;/span&gt; = &lt;span class=&quot;pt-n&quot;&gt;4711&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;17&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;pt-q&quot;&gt;&amp;#39;Integer: &amp;#39;&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;Devel::Size::size&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;\&lt;span class=&quot;pt-i&quot;&gt;$s3&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-q&quot;&gt;&amp;quot; Bytes\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;18&lt;/span&gt; &amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;19&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$s4&lt;/span&gt; = &lt;span class=&quot;pt-n&quot;&gt;1234.567&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;20&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;pt-q&quot;&gt;&amp;#39;Float: &amp;#39;&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;Devel::Size::size&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;\&lt;span class=&quot;pt-i&quot;&gt;$s4&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-q&quot;&gt;&amp;quot; Bytes\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;21&lt;/span&gt; &amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;22&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$s5&lt;/span&gt; = &lt;span class=&quot;pt-q&quot;&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;23&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$nLast&lt;/span&gt; = &lt;span class=&quot;pt-i&quot;&gt;Devel::Size::size&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;\&lt;span class=&quot;pt-i&quot;&gt;$s5&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;24&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;pt-q&quot;&gt;&amp;quot;String - leer: $nLast Bytes\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;25&lt;/span&gt; &amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;26&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$i&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pt-n&quot;&gt;1&lt;/span&gt;..&lt;span class=&quot;pt-n&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-n&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-n&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;{&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;27&lt;/span&gt;     &lt;span class=&quot;pt-i&quot;&gt;$s5&lt;/span&gt; = &lt;span class=&quot;pt-q&quot;&gt;&amp;#39;x&amp;#39;&lt;/span&gt;x&lt;span class=&quot;pt-i&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;28&lt;/span&gt;     &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$n&lt;/span&gt; = &lt;span class=&quot;pt-i&quot;&gt;Devel::Size::size&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;\&lt;span class=&quot;pt-i&quot;&gt;$s5&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;29&lt;/span&gt;     &lt;span class=&quot;pt-k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;pt-q&quot;&gt;&amp;quot;String - $i 1-Byte Zeichen: $n Bytes (Diff: &amp;quot;&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;$n&lt;/span&gt;-&lt;span class=&quot;pt-i&quot;&gt;$nLast&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-q&quot;&gt;&amp;quot;)\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;30&lt;/span&gt;     &lt;span class=&quot;pt-i&quot;&gt;$nLast&lt;/span&gt; = &lt;span class=&quot;pt-i&quot;&gt;$n&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;31&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;}&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;32&lt;/span&gt; &amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;33&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;@a1&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;34&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$nLast&lt;/span&gt; = &lt;span class=&quot;pt-i&quot;&gt;Devel::Size::size&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;\&lt;span class=&quot;pt-i&quot;&gt;@a1&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;35&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;pt-q&quot;&gt;&amp;quot;Array - leer: $nLast Bytes\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;36&lt;/span&gt; &amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;37&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$i&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pt-n&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-n&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-n&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-n&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-n&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;{&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;38&lt;/span&gt;     &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;@a2&lt;/span&gt; = &lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pt-n&quot;&gt;1&lt;/span&gt;..&lt;span class=&quot;pt-i&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;39&lt;/span&gt;     &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$n&lt;/span&gt; = &lt;span class=&quot;pt-i&quot;&gt;Devel::Size::size&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;\&lt;span class=&quot;pt-i&quot;&gt;@a2&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;40&lt;/span&gt;     &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$diff&lt;/span&gt; = &lt;span class=&quot;pt-i&quot;&gt;$n&lt;/span&gt;-&lt;span class=&quot;pt-i&quot;&gt;$nLast&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;41&lt;/span&gt;     &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$avg&lt;/span&gt; = &lt;span class=&quot;pt-i&quot;&gt;$n&lt;/span&gt;/&lt;span class=&quot;pt-i&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;42&lt;/span&gt;     &lt;span class=&quot;pt-k&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;pt-q&quot;&gt;&amp;quot;Array - $i Elemente: $n Bytes (Diff: $diff) - %.1f Bytes/Key\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;$avg&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;43&lt;/span&gt;     &lt;span class=&quot;pt-i&quot;&gt;$nLast&lt;/span&gt; = &lt;span class=&quot;pt-i&quot;&gt;$n&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;44&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;}&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;45&lt;/span&gt; &amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;46&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;%h1&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;47&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$nLast&lt;/span&gt; = &lt;span class=&quot;pt-i&quot;&gt;Devel::Size::size&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;\&lt;span class=&quot;pt-i&quot;&gt;%h1&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;48&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;pt-q&quot;&gt;&amp;quot;Hash - leer: $nLast Bytes\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;49&lt;/span&gt; &amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;50&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$i&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pt-n&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-n&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-n&quot;&gt;16&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-n&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-n&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-n&quot;&gt;128&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-n&quot;&gt;256&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-n&quot;&gt;512&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-n&quot;&gt;1024&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;{&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;51&lt;/span&gt;     &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;%h2&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;52&lt;/span&gt;     &lt;span class=&quot;pt-k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$j&lt;/span&gt; = &lt;span class=&quot;pt-n&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$j&lt;/span&gt; &amp;lt;= &lt;span class=&quot;pt-i&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$j&lt;/span&gt;++&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;{&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;53&lt;/span&gt;         &lt;span class=&quot;pt-i&quot;&gt;$h2&lt;/span&gt;{&lt;span class=&quot;pt-k&quot;&gt;sprintf&lt;/span&gt; &lt;span class=&quot;pt-q&quot;&gt;&amp;#39;Eintrag%04d&amp;#39;&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;$j&lt;/span&gt;} = &lt;span class=&quot;pt-i&quot;&gt;$j&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;54&lt;/span&gt;     &lt;span class=&quot;pt-s&quot;&gt;}&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;55&lt;/span&gt;     &lt;span class=&quot;pt-c&quot;&gt;# @h2{(1..$i)} = (1..$i);&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;56&lt;/span&gt;     &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$n&lt;/span&gt; = &lt;span class=&quot;pt-i&quot;&gt;Devel::Size::size&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;(&lt;/span&gt;\&lt;span class=&quot;pt-i&quot;&gt;%h2&lt;/span&gt;&lt;span class=&quot;pt-s&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;57&lt;/span&gt;     &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$diff&lt;/span&gt; = &lt;span class=&quot;pt-i&quot;&gt;$n&lt;/span&gt;-&lt;span class=&quot;pt-i&quot;&gt;$nLast&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;58&lt;/span&gt;     &lt;span class=&quot;pt-k&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;pt-i&quot;&gt;$avg&lt;/span&gt; = &lt;span class=&quot;pt-i&quot;&gt;$n&lt;/span&gt;/&lt;span class=&quot;pt-i&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;59&lt;/span&gt;     &lt;span class=&quot;pt-k&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;pt-q&quot;&gt;&amp;quot;Hash - $i Keys: $n Bytes (Diff: $diff) - %.1f Bytes/Key\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;pt-cm&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pt-i&quot;&gt;$avg&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;60&lt;/span&gt;     &lt;span class=&quot;pt-i&quot;&gt;$nLast&lt;/span&gt; = &lt;span class=&quot;pt-i&quot;&gt;$n&lt;/span&gt;&lt;span class=&quot;pt-sc&quot;&gt;;&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;61&lt;/span&gt; &lt;span class=&quot;pt-s&quot;&gt;}&lt;/span&gt;&amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;62&lt;/span&gt; &amp;#10;&lt;span class=&quot;sdoc-code-ln&quot;&gt;63&lt;/span&gt; &lt;span class=&quot;pt-c&quot;&gt;# eof&lt;/span&gt;&amp;#10;&lt;/pre&gt;
&lt;/div&gt; 
    </content:encoded>

    <pubDate>Tue, 12 Jan 2010 11:18:58 +0100</pubDate>
    <guid isPermaLink="false">http://fseitz.de/blog/index.php?/archives/11-guid.html</guid>
    
</item>
<item>
    <title>Perl-Interpreter über Shebang-Zeile suchen</title>
    <link>http://fseitz.de/blog/index.php?/archives/1-Perl-Interpreter-ueber-Shebang-Zeile-suchen.html</link>
            <category>Perl</category>
    
    <comments>http://fseitz.de/blog/index.php?/archives/1-Perl-Interpreter-ueber-Shebang-Zeile-suchen.html#comments</comments>
    <wfw:comment>http://fseitz.de/blog/wfwcomment.php?cid=1</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://fseitz.de/blog/rss.php?version=2.0&amp;type=comments&amp;cid=1</wfw:commentRss>
    

    <author>nospam@example.com (Frank Seitz)</author>
    <content:encoded>
    &lt;pre class=&quot;s-pre-box&quot;&gt;#!/usr/bin/env perl&lt;/pre&gt;

&lt;p&gt;Mit dieser Shebang-Zeile wird der Perl-Interpreter über die Environment-Variable
&lt;code&gt;$PATH&lt;/code&gt; gesucht. D.h. die Shebang-Zeile muss nicht angepasst werden, wenn das Skript
in mehreren Umgebungen mit unterschiedlichen Installationspfaden laufen soll.&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Thu, 07 Jan 2010 13:54:00 +0100</pubDate>
    <guid isPermaLink="false">http://fseitz.de/blog/index.php?/archives/1-guid.html</guid>
    
</item>

</channel>
</rss>