#!/usr/local/bin/perl
#Prints contents of STDIN to the screen
#noexec
require '/home/bear-008/users/downeyt/scripts/parse-lib.pl';

$content_type=$ENV{'CONTENT_TYPE'};
$boundary=$content_type;
($boundary) = ($content_type =~ /^multipart\/form-data; boundary=-*(\d*)/);
$len= length $boundary;


print "Content-type: text/plain\n\n";

$total=0;
$line=0;
while (read STDIN,$byte,1)
{
    $total++;
    $line++;
    $num = ord $byte;
    if ($num < 32) {
	$byte = "." ;
    }
    print "$byte";
    if ($line % 60 == 0) {
	print "\n";
	$line = 0;
    }
}
print "\ntotal = $total";










