ファイル名: ./w/autoin(de)crement.cgi

#!/usr/local/bin/perl

#------------------------------------------------------------
$Title = 'autoin(de)crement';
$BODY = '<BODY BGCOLOR="#000000" TEXT="#C0C0C0">';
print "Content-type: text/html\n\n";
print "<HTML><HEAD><TITLE>$Title</TITLE></HEAD>\n";
print "$BODY\n";
#-----------------------------------------------------------
print "<blockquote>\n";

$a = '1';
$A = '2';
$B = '3';
print "\$a = 1\n";
print "\$A = 2\n";
print "\$B = 3\n";
print "<BR><BR>\n";

print "\$a +=1は、\n";
print "++\$aと、書ける。〈インクリメント演算子)\n";
print "<BR><BR>\n";

print "<HR>\n";

print "\$b = ++\$a\n";
$b = ++$a;
print "<BR><BR>\n";

print "\$bは、\n";
print "$b\n";
print "<BR><BR>\n";
print "\$aは、\n";
print "$a\n";
print "<BR><BR>\n";

print "\$c = \$A++";
$c = $A++;
print "<BR><BR>\n";
print "\$cは、\n";
print "$c\n";
print "<BR><BR>\n";
print "\$Aは、\n";
print "$A\n";
print "<BR><BR>\n";

print "<HR>\n";

print "\$d = \$B--(デクリメント演算子)\n";
$d = $B--;
print "<BR><BR>\n";
print "\$dは、\n";
print "$d\n";
print "<BR><BR>\n";
print "\$Bは、\n";
print "$B\n";
print "<BR><BR>\n";

print "</blockquote>\n";
#-----------------------------------------------------------

print "</BODY>\n";
print "</HTML>\n";

exit;