「CGI_20080726_02」の編集履歴(バックアップ)一覧はこちら
「CGI_20080726_02」(2008/07/26 (土) 13:10:39) の最新版変更点
追加された行は緑色になります。
削除された行は赤色になります。
<p><br /><br />
aaa<br /><br />
<?xml version="1.0" encoding="Shift_JIS"?><br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"<br />
"<a href="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd</a>"><br />
<html xmlns="<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>"
xml:lang="ja"><br />
<head><br />
<title>ls用フォーム</title><br />
</head><br />
<body><br />
<h1>ls用フォーム</h1></p>
<p> <form action="ls01.cgi" method="post"
enctype="multipart/form-data"><br />
<p><br />
dir(Remote):<br />
<input type="text" name="updir"><BR></p><br />
<p><br />
<input type="submit" value="送信" /><br />
<input type="reset" value="リセット" /><br />
</p><br />
</form></p>
<p> </body><br />
</html><br /><br /><br /><br />
#!/usr/local/bin/perl -w</p>
<p># モジュール読み込み<br />
use strict;<br />
use CGI;</p>
<p>my ($buffer);</p>
<p># オブジェクト作成<br />
my $query = new CGI;</p>
<p># $f = $_POST['filename'];<br />
my $filename = $query->param('updir');</p>
<p># HTML出力<br />
print $query->header(-charset=>'Shift_JIS'),<br />
$query->start_html(-lang=>'ja', -encoding=>'Shift_JIS',
-title=>'ls01.cgi');</p>
<p><br />
print("===========================================<br>\n");<br />
print("===========================================<br>\n");<br />
print("===========================================<br>\n");</p>
<p>open(IN, "pwd |");<br />
while (<IN>) {<br />
print $_;<br />
print '<BR>';<br />
}<br />
close(IN);</p>
<p>print("===========================================<br>\n");<br />
print("===========================================<br>\n");<br />
print("===========================================<br>\n");</p>
<p><br />
print("===========================================<br>\n");<br />
print("===========================================<br>\n");<br />
print("===========================================<br>\n");</p>
<p>open(IN, "ls -alRtF $filename |");<br />
while (<IN>) {<br />
print $_;<br />
print '<BR>';<br />
}<br />
close(IN);</p>
<p>print("===========================================<br>\n");<br />
print("===========================================<br>\n");<br />
print("===========================================<br>\n");</p>
<p><br />
print("===========================================<br>\n");<br />
print("===========================================<br>\n");<br />
print("===========================================<br>\n");</p>
<p>open(IN, "ls -alR $filename |");<br />
while (<IN>) {<br />
print $_;<br />
print '<BR>';<br />
}<br />
close(IN);</p>
<p>print("===========================================<br>\n");<br />
print("===========================================<br>\n");<br />
print("===========================================<br>\n");</p>
<p> </p>
<p>print $query->end_html;<br />
exit;<br /><br /><br />
aaa</p>