HwloWorld
Hello World
出力
#!"C:/Perl64/bin/perl.exe"
print "Content-Type: text/html\n\n";
print("Hello World\n");
結果
HTMLソース結果
HTML文を記述
出力
#!"C:/Perl64/bin/perl.exe"
print "Content-Type: text/html\n\n";
print("<html>\n");
print(" <head>\n");
print(" <title>テスト</title>\n");
print(" </head>\n");
print(" <body>\n");
print("Hello World2\n");
print(" </body>\n");
print("</html>\n");
結果
HTMLソース結果
ヒアドキュメントによる出力
出力
#!"C:/Perl64/bin/perl.exe"
print "Content-Type: text/html\n\n";
my $title = "テストタイトル";
my $data = "テスト Hello World";
print <<HTML_EOF;
<html>
<head>
<title>$title</title>
</head>
<body>
<div>
$data
</div>
</body>
</html>
HTML_EOF
結果
HTMLソース結果
最終更新:2012年01月15日 18:07