Your question is a bit vague, so I assume that you have all the articles of the Big Boss as text files. For the lowest resistance solution, I would do the task like this :

Here's some really simple code to get you started :

use strict; my $article_directory = $ARGV[0] || "."; my $base_url = $ARGV[1] || "http://your.boss.net/BigBoss/articles/"; my @articles; print "Reading articles from $article_directory"; opendir DIR, $article_directory or die "Couldn't find $article_directo +ry : $!\n"; @articles = reverse sort grep /\.txt$/ readdir DIR; closedir DIR; print "$#articles articles found.\n"; # Now we have all articles in order. Let's print them out : open HTML, "> $article_directory/index.html" or die "Couldn't create i +ndex.html in $article_directory : $!" # Change the HTML to your taste print HTML "<html><body>" my $article; foreach $article (@articles) { print "."; my $title = $article; my $date = "No date given"; if ($article =~ /^(\d{4})-(\d{2})-(\d{2})-(.*).txt$/) { $date = "$3.$2.$1"; $title = $4; $title =~ tr/_/ /; }; print HTML "$date : <a href='$base_url$article'>$title</a>\n" }; print HTML "</body></html> close HTML;
perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web

In reply to Re: Need to make text file archive by Corion
in thread Need to make text file archive by peppiv

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.