#!/usr/local/bin/perl
# Name: unhtml.cgi
# Usage: To change any number of html files into text
$basedir = $ENV{'HOME'};
$htmldir = "$basedir/.www/humor/";
&bad_base unless (-e $htmldir);
chdir($htmldir);
foreach $FILE (@ARGV)
{
open(FILE,"$htmldir$FILE");
@lines = ;
close(FILE);
$contents = join '', @lines;
$contents =~ s/<[^>]*?>//g;
$contents =~ s/\n\s/\n/g; #cludge to get rid of leading spaces
print "$contents\n";
}
sub bad_base
{
print "$htmldir not found!";
}