operators.pl Source

#!/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("Operators");

$plus = 5+4;
$minus = 5-4;
$mult = 5*4;
$div = 5/4;
$combo = 5*4 + 5*4;
$parens = 5*(4+5)*4;

print "<br>5 + 4 = $plus \n";
print "<br>5 - 4 = $minus \n";
print "<br>5 * 4 = $mult \n";
print "<br>5 / 4 = $div \n";
print "<br>5*4 + 5*4 = $combo \n";

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

 Back
 Home