test.cgi

  test.cgi 10/16



  
#!/usr/local/bin/perl

# **********************************************************
# HTTP ヘッダの出力
# **********************************************************
print "Content-Type: text/html; Charset=shift_jis\n\n";

print "<HTML><HEAD>";
print "<STYLE type=text/css>  TD { font-size:40;background-color:white } </STYLE>";
print "</HEAD><BODY>";

$a = "田中";

print "<SPAN style='font-size:40'>";

print "私は$aです<br>";
print '私は$aです<br>';

print "一覧表<br>";
print '一覧表<br>';

@a = ("I","love","you");
foreach( @a ) {
    print "$_ ";
}


print "<TABLE border=5 cellpadding=10>";
@b = (1,10);
foreach( @b ) {
	print "<TR>";
	print "<TD>$_</TD>";
	print "</TR>";
}
print "</TABLE>";

%fruit = ("red", "apple", "yellow", "banana", "purple", "grape");
print $fruit{"red"} . "<br>";


print "<TABLE border=5 cellpadding=10 bgcolor=skyblue style='border-style:ridge'>";
%fruit = ("red", "apple", "yellow", "banana", "purple", "grape");
while (($key, $val) = each (%fruit)) {
	print "<TR>";
        print "<TD>キー $key</TD><TD>値 $val</TD>";
	print "</TR>";
} 
print "</TABLE>";


print "</SPAN>";
print "</BODY></HTML>";
  

  単独の変数



  
$num = 10;
print $num * 10 . "<br>";
print "$num * 10<br>";

$str = "this is a pen.";
print "$str<br>";
  

  配列の要素の参照

  
# ***********************************************
print '@str = ("this", "is", "a", "pen" );';
print "配列の要素の参照<br>" . 'print $str[2] -->';
# ***********************************************
@str = ("this", "is", "a", "pen" );
print $str[2] . "<br>";

for( $i = 0; $i <= $#str; $i++ ) {
	print $str[$i] . "<br>";
}
  











   SQLの窓    create:2002/10/16  update:2014/09/07   管理者用(要ログイン)





フリーフォントWEBサービス

SQLの窓WEBサービス

SQLの窓フリーソフト

写真素材

一般WEBツールリンク

SQLの窓

フリーソフト

JSライブラリ