BEGIN:VCALENDAR
VERSION:2.0
X-WR-CALNAME:source2html
X-WR-CALDESC: I needed to print out a directory full of small scripts. This Perl script will go through the current directory and create a pretty HTML page of all the files in that directory. That HTML page can then be fed to a browser for printing.  #!/usr/bin/perl  $cd = `pwd`; chomp $cd; $ls = `ls -1 $cd`; @ls = split(/\n/,$ls);  print "&lt;title&gt;Directory Listing $cd&lt;/title&gt;\n"; print "&lt;h1&gt;Directory Listing $cd&lt;/h1&gt;\n";  $ll = `ls -l '$cd'`; chomp $ll; print "&lt;pre style='padding:1em'&gt;&lt;b&gt;$ll&lt;/b&gt;&lt;/pre&gt;\n\n";  foreach $f (@ls) {    if (!(-d $f)) {      $l = `ls -l '$f'`; chomp $l;     print "&lt;div style='border:2px solid black;padding:1em;'&gt;\n";     print "&lt;h2 style='margin:0;padding:0;'&gt;$f&lt;/h2&gt;\n";     print "&lt;pre&gt;&lt;b&gt;$l&lt;/b&gt;&lt;/pre&gt;\n";     print "&lt;/div&gt;\n";      $t = `cat '$f'`;     $t =~ s/&amp;/&amp;amp;/g;     $t =~ s/&lt;/&amp;lt;/g;     $t =~ s/&gt;/&amp;gt;/g;      print "&lt;pre style='padding:1em'&gt;$t&lt;/pre&gt;\n\n";    }  }  This software is distributed under the terms of the GNU GPL.  
END:VCALENDAR
