ファイル名: ./j/foreach1.cgi

#!/usr/local/bin/perl

# -----------------------------------------------------
# 繰り返し制御 [1] (ファイル名: foreach1.cgi )
# -----------------------------------------------------
$Title = '繰り返し制御 [1]';
# ------------------- HTML ----------------------
print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<HEAD>\n";
print "<TITLE>$Title</TITLE>\n";
print "</HEAD>\n";
print "<BODY bgcolor=#000000 text=#ffff99>\n";

# *************** Perl *******************

@array = ("a","b","c");

print "\@array = @array <BR><BR>";

print "<blockquote>\n";

  foreach $ABC (@array) {
    $No ++;
    print "$No"," = ","$ABC<BR>";
  }

print "</blockquote>\n";

# ****************************************


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

exit;