Source

perl-begin / src / tutorials / modern-perl / index.html.wml

Full commit
#include '../template.wml'

<latemp_subject "Modern Perl Online Book" />

<p>
This is our own mirror of the book
<a href="http://onyxneon.com/books/modern_perl/"><i>Modern Perl</i></a> by
<a href="http://www.wgz.org/chromatic/">chromatic</a>. It is distributed
under the
<a href="http://creativecommons.org/licenses/by-nc-sa/3.0/us/"
rel="license">Creative
Commons Attribution-Noncommercial-Share Alike 3.0 United States License</a>
(CC-by-nc-sa).
</p>

<h2 id="chapters">Chapters</h2>

<ul>
<:{
{
    use strict;
    use warnings;
    use XML::LibXML;
    use CGI ();

    foreach my $idx (0 .. 12)
    {
        my $chapter_frag = sprintf("chapter_%02d", $idx);
        my $chapter_xhtml_fn = "xhtml/$chapter_frag.html";

        my $dom = XML::LibXML->load_html(
            location => "./tutorials/modern-perl/$chapter_xhtml_fn",
        );
        my $title = $dom->findnodes('//h2')->[0]->textContent();

        printf qq{<li><b>Chapter %d</b> (<a href="%s">HTML</a> , <a href="pdf/%s.pdf">PDF</a>) - %s.</li>\n},
            ($idx, $chapter_xhtml_fn, $chapter_frag, CGI::escapeHTML($title))
        ;
    }
}
}:>
</ul>

<h2 id="epub">EPUB</h2>

<p>
<a href="epub/modern_perl.epub">Modern Perl EPUB</a>
</p>