#!/usr/local/bin/perl use CGI qw(:standard); #################################################### # # CatchDoubles.cgi # # Receives input from doubles.cgi # # #################################################### # # Get the parameters $Player = param('hitter'); #################################################### # # Start HTML page print header(), start_html("Baseball Facts"), h2("Facts about $Player"), hr; #################################################### # # Open file and manipulate data open(STUFF,"doubles") || die "Cant open file doubles"; while (<STUFF>) { if ($_ =~ /$Player/i) { ($date,$team,$number) = /date: (....).*team: (.*)\snumber: (..)/; print "When $Player was a member of the $team team", br, "He hit $number doubles in the year $date", br; } } print hr, end_html;