#!perl # Print out a content-type for HTTP/1.0 compatibility # (Put this here at very top so that all printouts work!) #print <<"HEAD"; #Content-type: text/html #Expires: Tue, 25 Apr 1995 09:30:00 -0700 # #HEAD print "Content-type: text/html\n\n"; # Get the input form the FORM read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); # Split the name-value pairs @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); # Un-URL plus signs and %-encoding $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; # Stop people from using subshells to execute commands # Not a big deal when using sendmail, but very important # when using UCB mail (aka mailx). $value =~ s/~!/ ~!/g; # Store the value in our associative array $FORM{$name} = $value; } #Print data results out to a page print ""; print ""; print "Thank you for your interest "; print ""; print ""; print ""; print "
"; print "
"; print " Quotes"; print "

The Value Point Financial Forum

"; print "

POSTED VALUE POINT(VP) ANALYSIS STOCKS

"; print "

"; print "Stocks are Listed in Alphabetical Order"; print "
"; print "
"; print "
"; print "
"; print "
"; 
print "";
print "Stock Name, Sym, and Exchange                  Stock VP(\$/sh)  VP/Curr.Pr  Rel. Risk  Posting Date";
print "";
print "
"; #print "
"; print "
";

############## READ DATABASE FILE
if (open(LOGR,"\\cyberspace\\html\\eduvest\\database.dat"))  
{
  while ()
  {
    @fields = split(/#/, $_);   #date,name,vp,e1,x1,x2
    $date   =$fields[0];        #date
    $name   =$fields[1];        #name
    $vp     =$fields[2];        #V value point
    $currp  =$fields[5];        #X2 curr value
    $rrf    =$fields[21];       #RRF relative risk factor

    $name1=sprintf("%-30s",$name);
    $name2=sprintf("%-30s",$name);
	$name2=~tr/a-z/A-Z/; 			# Turn to uppercase for sorting
    $vp1  =sprintf("%7.2f",$vp);
    $currp=sprintf("%5.2f",$currp);
    $rrf=sprintf("%5.2f",$rrf);
	push (@records,"$name2=$name1=$name=$date=$vp1=$vp=$currp=$rrf");
	   
    #print "$name1 $vp1      $currp       $rrf      $date";  
    #print "
"; } close(LOGR); @records=sort @records; foreach $record (@records) { #print "$record
"; ($name2,$name1,$name,$date,$vp1,$vp,$currp,$rrf) = split(/=/,$record); if (index($name1,"DowJonesIndustrial")!=-1) { print "$name1 $vp1 $currp $rrf $date"; } else { print "$name1 $vp1 $currp $rrf $date"; } print "
"; } } else { &badfile(); } ############# END READ print "
"; print "
"; print "
"; print "
"; print "
"; print "Return to Main Menu."; print "
"; print ""; print ""; # ------------------------------------------------------------ # subroutine date sub date { # ctimeCQ outputs in format "TUE_04_01_200317_25_24" require "ctimeCQ.pl"; $now1 = &ctimeCQ(time); $date = substr($now1,0,14); $time = substr($now1,14,22); $date=~ tr/_/\//; #replace underscores w slashes $time=~ tr/_/\:/; #replace underscores w colons $now1 = sprintf("%s %s",$date,$time); #`date` will not compile in this version of perl #$date = `date`; #$date = substr($date,index($date,":")+2,14); #$time = `time`; #$time = substr($time,index($time,":")+2,11); #$now1 = sprintf("%s %s",$date,$time); #$now1; } # ------------------------------------------------------------ # subroutine badfile sub badfile { print <<"HTML"; Thank you for your interest


Could not open database.dat

Return to Main Menu.
HTML exit(0); }