#!/usr/bin/perl push(@INC,"/www/cgi-bin"); require 5.003; require "cgi-lib.pl"; #-------------------------- What This Does ---------------------------- # Input data: x, y. # Output: x + y #---------------------------- Main Program ---------------------------- # The subroutine &ReadParse" (from the external utility program # cgi-lib.pl) gets the data that was just submitted and makes it # available to you. For instance $in{x} has the value of x . &ReadParse; # The subroutine "&PrintHeader" (also from cgi-lib.pl) is essential # to print output to the voter's screen. print &PrintHeader; $z = $in{x} + $in{y}; print <<"end"; Math 210, Perl Example 1 1

Output for Example 1

Your input: x = $in{x}, y = $in{y}

Answer: x + y = $z

end