おみくじ(rand, int)
#! /usr/local/bin/perl @kuji = ('大吉','中吉','小吉','吉','凶'); #おみくじの配列 $rand = int(rand 5); #0〜4の乱数 # HTML出力 print "Content-type: text/html\n\n"; print "<html>\n"; print "<head>\n"; print "<title>おみくじ</title>\n"; print "</head>\n"; print "<body>\n"; print "$kuji[$rand]<br>\n"; print "</body>\n"; print "</html>\n"; exit;
〔 実行する 〕