<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1251"></HEAD>
<BODY><PRE>#!/usr/bin/perl
print "===================================================\n";
print "Perl calculator by Mourat Djoussoupov / Novosibirsk\n";
print "===================================================\n";
print "\n";
$x = 0;
$y = 0;
$oper = "";
print "ENTER first number:\n";
print "&gt; ";
$x = &lt;STDIN&gt;;
chomp ($x);
print "ENTER operation +, -, *, /:\n";
print "&gt; ";
$oper = &lt;STDIN&gt;;
chomp ($oper);
print "ENTER second number:\n";
print "&gt; ";
$y = &lt;STDIN&gt;;
chomp ($y);
if ($oper eq "+") {$result = $x + $y;}
elsif ($oper eq "-") {$result = $x - $y;}
elsif ($oper eq "*") {$result = $x * $y;}
elsif ($oper eq "/") {$result = $x / $y;}
print "===================================================\n";
print "$x $oper $y = $result\n";
print "===================================================\n";
</PRE></BODY></HTML>
