#!/usr/bin/perl use config; #---------------------------------------------------------------------------------- =pod my $analytics = "UA-4102000-19"; link_separator = ' · '; analytics_id = 'UA-4102000-19'; more = 'plus'; srch = 'recherche'; trms = 'mots clés :'; home = 'accueil'; //---- contact page cfirst = 'prénom'; clast = 'surnom'; cemail = 'adresse mail'; csend = ' ...'; csent = 'Message envoyé -- merci !'; cmess = 'taper ici...'; use config qw(:DEFAULT $testy); =cut #---------------------------------------------------------------------------------- print < HEREDOC
[ICO]Name

[PARENTDIR]Parent Directory

#!/usr/bin/perl -w use strict; use warnings; #---------------------------------------------------------------------------------- print < HEREDOC #---------------------------------------------------------------------------------- # output errors to browser use CGI; use CGI::Carp qw(warningsToBrowser fatalsToBrowser); #---------------------------------------------------------------------------------- # =pod/=cut are comment blocks #---------------------------------------------------------------------------------- use functions qw(:DEFAULT makeTitle); #---------------------------------------------------------------------------------- # list directory my $dir = $ENV{'DOCUMENT_ROOT'}.$ENV{'REQUEST_URI'}; opendir(DIR, $dir) or die $!; # ends with ".txt" and is a file my @dots= grep { m/\.txt$/ && -f "$dir/$_" } readdir(DIR); #---------------------------------------------------------------------------------- # sort the page array my @pages = reverse(sort @dots); #---------------------------------------------------------------------------------- # Loop through the array printing out the filenames foreach my $file (@pages) { my @lines = contentsOf($dir, $file); # remove last element if it's empty while (length(@lines[-1]) < 3 && scalar(@lines) > 2){ pop (@lines); } #---------------------------------------------------------------------------------- # add title, header & footer tags @lines[0] = makeDate(@lines[0] ); @lines[1] = makeTitle(@lines[1]); @lines[-1] = makeTags(@lines[-1]); #---------------------------------------------------------------------------------- # remove second to last line if it's empty #---------------------------------------------------------------------------------- my $entry = join("", @lines); print "$entry\n
"; } #---------------------------------------------------------------------------------- # close out the directory closedir(DIR); #---------------------------------------------------------------------------------- # close out html page print "
footer in readme.html
"; #---------------------------------------------------------------------------------- # close out perl exit 0; #----------------------------------------------------------------------------------