The Condensed Version

#!/usr/local/bin/perl
 
#    Use the CGI.pm library
use CGI;
 
# Make a new CGI object.
$query = new CGI;
 
 
#   Write out the content-type header followed by a blank line.
print $query->header;

#   Write the HEAD section, including the title.
print $query->start_html("Your Data");

$bearcatID = $query->param('bearcatID');

open(PAGE, "<../accountdata.txt");
@data = <PAGE>;
close(PAGE);

# Find the correct data for this user.

foreach $words(@data) {
      ($ID, $firstName, $lastName) = $words =~ /(\S*)\~(\S*)\~(\S*)/;

      # Assign the input data to a hash, for use later.
      $first{$ID} = $firstName;
      $last{$ID} = $lastName;
}

# Use the has and the bearcat ID to print a welcome message.

print "Welcome $first{$bearcatID} $last{$bearcatID} !";

#   End the form.
print $query->end_html;
 
 
 
 
 
 

 Home