Assignment 7 : CGI

Study the following codes and modify as given.

  • Perl program to sum numbers : HTML Source PERL Source

  • Perl program to display marks : HTML Source PERL Source Datafile

  • Shell program to sum numbers : HTML Source Shell Source

  • Shell program to display marks : HTML Source Shell Source Datafile



  • Add following functionalities to the existing code for PERL and Shell both.
  • Find class average.
  • Find number of students having marks greater than some value.
  • Find number of students having marks between two values.
  • Provide password mechanism to the user i.e. the user will be able to view the datafile only after entering a correct password through the form.


  • Add more values to the datafile as per your requirement. Make suitable assumptions wherever necessary.

    How to run a cgi script


    CGI has been enabled on pro-23.cse.iitb.ac.in
    Connect to pro-23.cse.iitb.ac.in
    Go to the directory /home/httpd/cgi-bin/USERNAME/
    where USERNAME is your login name.
    Install your shell or perl script in this directory.
    The action in the HTML form should be set to "http://pro-23.cse.iitb.ac.in/cgi-bin/processform.pl"
    For example
    < form action="http://pro-23.cse.iitb.ac.in/cgi-bin/USERNAME/processform.pl" method=get >
    where procesform.pl is the name of the perl script to process the form data.