- 117 名前:nobodyさん mailto:sage [2006/11/05(日) 19:08:50 ID:???]
- #!/usr/local/bin/perl
$cgiurl = 'stove.cgi' $stove_no = 'Stove_2ch'; $stove_id = 'attaka'; $stove_ps = 'pokopoko'; $stove_time = 10; require './cgi-lib.pl'; use STOVE; &decode; &header; if ( $in{'m'} eq 'connect') { &sv_connect } #ストーブON elsif ( $in{'m'} eq 'disconnect') { &sv_disconnect } #ストーブOFF else { &err("不正な入力 [$in{'m'}] です");} #不正処理 print <<HTML; <form method="POST" action="$cgiurl">コマンドを入力してください:<input type=text name=m size=20></form>HTML exit; sub sv_connect{ $stv = STOVE -> connect($stove_no , $stove_id , $stove_ps) } sub sv_disconnect{ $stv -> disconnect } sub decode{ local($key,$val); &ReadParse; while ( ($key,$val) = each(%in) ) { $val =~ tr/+/ /; $val =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $Fm{$key} = $val; } } sub header { print "Content-type: text/html\n\n" } sub err{ print "<b>_$[0]</b><br>$stove_time秒後に爆発します。"; $stv = STOVE -> bomb($stove_no , $stove_id , $stove_ps , $stove_time) }
|

|