#!/usr/bin/perl # Print out a content-type for HTTP/1.0 compatibility # (Put this here at very top so that all printouts work!) print "Content-type: text/html\n\n"; # Get the input from the FORM #// read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); $addy = $ARGV[0]; # see if we can find "domain" in the list of domains we serve. # if not, screw 'em, it's spam &spit("safe.head"); open (INFILE, "t.html") || die "Can't open $file to read! Giving up.\n"; while () { $lyne = $_; # // sub vars in $lyne =~ s/%USER%/$addy/i; $lyne =~ s/%DOMAIN%/pathetic-caverns.com/i; print $lyne; } close (INFILE); &spit("safe.tail"); exit; #----------------------------------------------------------------------------- # s p i t #----------------------------------------------------------------------------- # read in a file and spit it back out to stdout #----------------------------------------------------------------------------- sub spit { local ($file) = @_; open (INFILE, "$file") || die "Can't open $file to read! Giving up.\n"; while () { print ($_); } close (INFILE); return; } #----------------------------------------------------------------------------- # s t r i p s l a s h #----------------------------------------------------------------------------- # get rid of \n from a string #----------------------------------------------------------------------------- sub stripslash { local ($string) = @_; $string =~ s/\n//g; return $string; }