Perl/ActivePerl For UNIX/Linux/Windows
 
TryThe Homepage
ソスソスソス゚てゑソスCGI
CGI ソスソスソスソスソスソス
ソス_ソスCソスiソス~ソスbソスNCGI
ソス_ソスEソスソスソスソスソス[ソスh
ソスTソス[ソスrソスX
ソスTソス[ソスoソス\ソスz(Windows)
ソスfソス[ソス^ソスxソス[ソスXソスAソスNソスZソスX
ソスLソスソスソスTソス[ソスrソスX
FAQ
ソスソスソス竄「ソスソスソスせ
ソスソスソスフペソス[ソスWソスソスソスソスソス
ソスソスソスソスソスソスソスソスソスナ学ソスソスPerlソスuソスソス
ソスソスソスソスソスソスソスンボソス[ソスhソス生撰ソスソスソスソスソスソスソス@ソスヘ、ソス蛯ォソスソスソスソスソスソスソスト2ソスツ有ソスソスワゑソスソスB ソスPソスツは、ソスソスソスヘデソス[ソス^ソスソスHTMLソスRソス[ソスhソスノ変奇ソスソスソスソスト、HTMLソスhソスLソスソスソスソスソスソスソスgソスノ追会ソスソスソスソスソスソスソス@ソスB ソスソスソスソスソスPソスツは、ソスソスソスヘゑソスソス黷スソスfソス[ソス^ソスソスソスfソス[ソス^ソスtソス@ソスCソスソスソスノ保托ソスソスソスソスAソスuソスソスソスEソスUソスソスソスソストび出ソスソスソス黷スソスニゑソスソスAHTMLソスhソスLソスソスソスソスソスソスソスgソス生撰ソスソスソスソスソスソスソス@ソスナゑソスソスB
ソスソスソスTソスCソスgソスナ紹介すソスソスXソスNソスソスソスvソスgソスヘ、ソスソスソスラて鯉ソスメのデソス[ソス^ソスxソス[ソスXソス`ソスソスソスソスソスフ用ソスソスソストゑソスソスワゑソスソスB ソスOソスメは、ソスソスソスソスソスソスソスワゑソスソスHTMLソスhソスLソスソスソスソスソスソスソスgソスtソス@ソスCソスソスソスソスソスKソスvソスネゑソスソス゚、ソスソスソスヘフソスHソス[ソスソスソスニ、ソス\ソスソスソスソスソスソスhソスLソスソスソスソスソスソスソスgソスtソス@ソスCソスソスソスソスソスハ々ソスノ必ソスvソスナゑソスソスB ソスソスソスソスソスソスソスAソスソスソスソスソスソスソスン鯉ソスAソスソスソスハゑソスソスuソスソスソスソスソスノ」ソスソスソスfソスソスソスソスワゑソスソスソスBソスuソスソスソスEソスUソスソスソスソスxソスヌみ搾ソスソスだドソスLソスソスソスソスソスソスソスgソスヘ、ソスLソスソスソスbソスVソスソスソスノ保托ソスソスソスソスA ソスソスxソスレゑソスソスソスヘキソスソスソスbソスVソスソスソスフドソスLソスソスソスソスソスソスソスgソスソスWソスJソスソスソス驍ゥソスソスナゑソスソスBソスiソスソスソスソスソス[ソスhソスソスソスソスホ話ソスソスソスヘ別)
ソスワゑソスソスAソスuソスソスソスEソスUソスソスソスソスフ擾ソスソスソスソスソスソス謫セソスソスソスAソス\ソスソスソスソスソスソスfソス[ソス^ソスソスAソス`ソスソスソスソスマ更ソスナゑソスソスネゑソスソスフでデソス[ソス^ソスン奇ソスソスソスソスソスソスツバソス[ソスWソスソスソスソスソスAソスbソスvソスソスソスsソスネゑソスソスワゑソスソスソスB
ソスソスソスソスソスナ紹介すソスソスuソスソスソスソスソスソスソスソスソスvソスソスソスArakugaki.cgi ソスXソスNソスソスソスvソスgソスニ、rakugaki.txt ソスfソス[ソス^ソスtソス@ソスCソスソスソスナ難ソスソスしソスA ソスuソスソスソスEソスUソスソスソスソストび出ソスソスソスソスソスフは、ソスXソスNソスソスソスvソスgソスソスソスソスソスナゑソスソスB

rakugaki.cgi
  1. ソスソスソスCソスソスソスソスソス[ソス`ソスソス
    ソスソス{ソスIソスネデソス[ソス^ソスフ取得ソスソスAソスソスソスソスソスフ暦ソスソスソスソスソスソスソス゚てゑソスソスワゑソスソスB ソスソスソスネゑソスソスソスソスソスソスソスソスソスソストゑソスソスソスvソスソスソスoソスCソス_ソスソスperlソスソスソスソスソスsソスナゑソスソスソスpソスXソスソスソスwソス閧オソスワゑソスソスB
    ソスソスハ的ソスノ、#!/usr/bin/perソスソスA#!/usr/local/bin/perlソスソスソスソスソスソスソス謔、ソスナゑソスソスB
    #!/usr/local/bin/perl
    ソスソスソスソスソスソスソス轤ェソス{ソスソスソスBソスソスソスフ擾ソスノ具ソスsソスソスソスPソスsソスJソスソスソスワゑソスソス蛯、ソスB
    ソスソスソス{ソスソスマ奇ソスソスソスソスCソスuソスソスソスソスソスフ宣言
    require 'jcode.pl';
    ソスoソス^ソス{ソス^ソスソスソスソスソスソスソスソスソスソスAソスfソス[ソス^ソスソスソスソスソスソスソスソスソスン鯉ソスuソスソスソスEソスUソスソスソスソスソスtソスソスソスbソスVソスソスソスソスソス驍スソス゚に「ソスソスソスソスソスソスソスソスソスvソスソスン置ソスソスソスソスURLソスソスソスwソス閧オソスワゑソスソスB
    $rakugakiurl = 'http://www.tryhp.net/cgi-bin/rakugaki.cgi';
    #ソスfソス[ソス^ソスソスロ托ソスソスソスソスソスtソス@ソスCソスソスソスフ厄ソスソスOソスソスソスwソス閧オソスワゑソスソスB
    $rakugakifile = 'rakugaki.txt';
    #ソスソスソスン難ソスソスtソスニ趣ソスソスソスソスソスソスVソスXソスeソスソスソスソスソスソス謫セソスソスソスAソスtソスHソス[ソス}ソスbソスgソス整ゑソスソスワゑソスソスB
    #localtimeソスヨ撰ソスソスソスソスヤゑソスソスlソスソスソスソスソス黷シソスソスマ撰ソスソスノ托ソスソスソスソスソスワゑソスソスB
    ($sec,$min,$hour,$day,$mon,$year,$wday,$yday,$isdst) = localtime(time);
    $year += 1900;
    #ソス謫セソスソスソスソスソスソスソスlソスソスソスQソスソスソスノ難ソスソス黷オソスワゑソスソスBソスQソスソスソスノ難ソスソス黷キソスソスフは、ソスソスソスソスソスレゑソスソス謔ュソスソスソス驍セソスソスソスナなゑソスソスA
    #ソスソスソスtソスノゑソス髀クソスソスソスAソス~ソスソスソスフ包ソスソスム替ゑソスソスソスソスsソスネゑソスソスソスソス゚でゑソスソスB
    #ソスソスソスム替ゑソスソスヘ、ソスAソスXソスLソス[ソスRソス[ソスhソスナ行ソスネゑソスソスワゑソスソスフで、
    #ソスuソスQソスvソスニ「ソスPソスOソスvソスナは「ソスPソスOソスvソスソスソスソスソスソスソスソスソスニ費ソスソスfソスソスソスソス驍ゥソスソスナゑソスソスB
    #ソスuソスソスソスvソスフデソス[ソス^ソスヘ、ソスOソスソスソスソスPソスPソスネので、ソスPソスvソスソスソスXソスソスソスソスB
    $mon = sprintf("%02d", $mon + 1);
    $day = sprintf("%02d", $day);
    $hour = sprintf("%02d", $hour);
    $min = sprintf("%02d", $min);
    #ソスtソスHソス[ソス}ソスbソスgソス整ゑソスソスワゑソスソスB
    #ソス_ソスuソスソスソスNソスHソス[ソスgソスuソスhソスvソスナ囲まれたソス關費ソスフ抵ソスソスフ変撰ソスソスヘ趣ソスソスソスソスナ展ソスJソスソスソスソスワゑソスソスB
    $date_now = "$yearソスN$monソスソス$dayソスソス $hourソスソス$minソスソス";
    ソスtソスHソス[ソスソスソスソスソスソスフデソス[ソス^ソスソスマ撰ソス$formdataソスノ取得
    ソスソスソス\ソスbソスhソスvソスソスソスpソスeソスBソス[ソスノゑソスソスソスト取得ソスソスソス@ソスソスソスルなゑソスワゑソスソスフで、ソスヌゑソスソスソスナゑソスソス謫セソスナゑソスソスソス謔、ソスノゑソスソスワゑソスソスB
    if ($ENV{'REQUEST_METHOD'} eq "POST") {
      read(STDIN, $QUERY_DATA, $ENV{'CONTENT_LENGTH'});
    } else { $formdata = $ENV{'QUERY_STRING'}; }
    ソスtソスHソス[ソスソスソス迹暦ソスソスソストゑソスソスソスソスfソス[ソス^ソスヘ、name=ソスソスソスq&[email protected]&comment=ソスnソス゚まゑソスソスト具ソスソスqソスナゑソスソスB
    ソスフようソスノ、ソスuソスソスソスvソスナ具ソスリゑソスソスト托ソスソスソスソストゑソスソスワゑソスソスBソスソスソスフデソス[ソス^ソス分会ソスソスソスソスAソスyソスAソスノゑソスソスワゑソスソスB
    @pairs = split(/&/,$QUERY_DATA);
    foreach $pair (@pairs) {
      ($name, $value) = split(/=/, $pair);
      #ソスsソスKソスvソスネ包ソスソスソスソスソスソス除ソスソスソスAソスfソスRソス[ソスhソスソスソスワゑソスソスB
      $value =~ tr/+/ /;
      $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
      #ソス^ソスOソスソスソスソスソスヘゑソスソスソストゑソスソスソスホ、ソスソスソスソス無鯉ソスソスノゑソスソスワゑソスソスB
      $value =~ s/</&lt;/g;
      $value =~ s/>/&gt;/g;
      $value =~ s/\n//g;
      $value =~ s/\,//g;
      #ソスナ擾ソスソスノ宣言ソスソスソスソスソスソスソス{ソスソスマ奇ソスソスソスソスCソスuソスソスソスソスソスソスソストび出ソスソスソスAソスVソスtソスgjisソスノ変奇ソス
      &jcode'convert(*value,'sjis');
      #ソスソスソスソスソスソスソスソスソスfソス[ソス^ソスソスソスLソス[ソスナ呼び出ソスソスソスソス謔、ソスAソスAソスzソスzソスソスノ格ソス[ソスソスソスワゑソスソスB
      $FORM{$name} = $value;
    }
    ソスソスソスフスソスNソスソスソスvソスgソスソスソスソスソスソスソスソスソスソストび出ソスソスソス黷スソスソスソスナ擾ソスソスソスソス分岐しまゑソスソスB
    ソスtソスHソス[ソスソスソスソスソスソストび出ソスソスソス黷スソスフでゑソスソスソスホ、$FORM{'action'}ソスソスソスutrueソスvソスノ、 ソスソスソス゚て呼び出ソスソスソス黷スソスフなゑソス$FORM{}ソスマ撰ソスソスソス'action'ソスニゑソスソスソスソスソスソスOソスソスソス迹カソスンゑソスソスネゑソスソスB
    $FORM{'action'}ソスソスソスutrueソスvソスネゑソスtソスHソス[ソスソスソスソスソスソスネので擾ソスソスソスソスソスソスンソスソス[ソス`ソスソスソスヨ、
    if ($FORM{'action'} eq "true") { &regist; }
    #ソスソスソスソスネ外ソスネゑソスHTMLソスhソスLソスソスソスソスソスソスソスgソス生撰ソスソスソスソスソス
    else { &html; }

  2. HTMLソスhソスLソスソスソスソスソスソスソスgソスソスソスソスソスソスソス[ソス`ソスソス
    sub html {
      #ソスfソス[ソス^ソスtソス@ソスCソスソスソスソスヌみ搾ソスソスンソスソス[ソスhソスIソス[ソスvソスソスソスソスソスA
      #ソスソスソスラてのデソス[ソス^ソスソスzソスソスマ撰ソス@DATAソスノ格ソス[ソスソスソスワゑソスソスB
      if (!open(NOTE,"$rakugakifile")) { &error(bad_file); }
      @DATA = <NOTE>;
      close(NOTE);
      #ソスヌみ搾ソスソスワれたソスfソス[ソス^ソスヘ、ソスoソス^ソスソスソスiソステゑソスソスソスソスjソスノ保托ソスソスソスソスソストゑソスソスソスフで、ソスVソスソスソスソスソスソスソスノ包ソスソスム替ゑソスソスワゑソスソスB
      @DATA = reverse(@DATA);
      #HTMLソスhソスLソスソスソスソスソスソスソスgソス生撰ソスソスソスソスワゑソスソスB
      print "Content-type: text/html\n\n";
      print "<!DOCTYPE HTML PUBLIC -//IETF//DTD HTML//EN>\n";
      print "<html>\n";
      print "<head>\n";
      print "<meta http-equiv=Content-Type content= text/html; charset=x-sjis>\n";
      print "<title>ソスソスソスソスソスソスソスソス</title></head>\n";
      #ソスoソスbソスNソスOソスソスソスソスソスhソスニ包ソスソスソスソスFソスソスソスwソスソス
      print "<body bgcolor=#000000 text=#FFFFFF>\n";
      #ソスhソスLソスソスソスソスソスソスソスgソスフ上部ソスAソスRソスソスソスソスソスgソスソスソスヘフソスHソス[ソスソスソス生撰ソス
      #[ソスソスソスソスソスソスソスソス]ソス{ソス^ソスソスソスソスソスソスソスソスソスソスソスニ難ソスソスヘゑソスソス黷スソスfソス[ソス^ソスソスソスソスソスソスソスソスrakugaki.cgiソスソスソスト度ソストび出ソスソスソスワゑソスソスB
      print "<form action=rakugaki.cgi method=POST>\n";
      #ソスPソスツのスソスNソスソスソスvソスgソスナ擾ソスソスソスソス分岐するたソス゚、ソスソスソスソスソスネゑソスソスtソスソスソスOソスソスン抵ソス
      print "<input type=hidden name=action value=true>\n";
      print "<div align=center><center>\n";
      print "<table border=1 cellspacing=1>\n";
      print "<tr>\n";
      print "<td align=center>ソスjソスbソスNソスlソス[ソスソス</td>\n";
      print "<td><input type=text size=29 name=name></td>\n";
      print "</tr>\n";
      print "<tr>\n";
      print "<td align=center>E-mail</td>\n";
      print "<td><input type=text size=29 name=email></td>\n";
      print "</tr>\n";
      print "<tr>\n";
      print "<td align=center>ソスソスソスソスソスソスソスソス</td>\n";
      print "<td><textarea name=comment rows=4 cols=68></textarea></td>\n";
      print "</tr>\n";
      print "<tr>\n";
      print "<td align=center colspan=2><input type=submit value=ソスソスソスソスソスソスソス痰ヲ></td>\n";
      print "</tr>\n";
      print "</table></center></div>\n";
      print "</form>\n";
      #ソスソスソスソスソスワでゑソスソスソスソスヘフソスHソス[ソスソス
      #ソスソスソスソスソスソスソス轤ェソスAソスソスソスソスソスソスソスLソスソスソス生撰ソスソスソスソスワゑソスソスB
      print "<div align=center><center>\n";
      #ソスロ托ソスソスソスソスソストゑソスソスソスfソス[ソス^ソスソスソスネゑソスソスネゑソスワで繰ソスソスヤゑソスソスB
      foreach $line (@DATA) {
        #ソスtソス@ソスCソスソスソスソスソスソスヌみ搾ソスソスだデソス[ソス^ソスフ最鯉ソスノは会ソスソスsソスソスソスソスソスソスソスツゑソスソストゑソスソスソスフで擾ソスソスソス
        chop($line);
        #ソスPソスsソスフデソス[ソス^ソスソスソスeソスソスソスレに包ソスソスソスソスソスソスワゑソスソスB
        #ソスソスソスtソスAソスソスソスOソスAソスソスソス[ソスソスソスAソスRソスソスソスソスソスgソスフ擾ソスソスノ格ソス[ソスソスソスソスワゑソスソスB
        #ソスソスソスソスネ降ソスソス$d1ソス`$d4ソスヘ擾ソスソスソスソスフバソス[ソスWソスソスソスソスソスAソスbソスvソスフゑソスソス゚ダソス~ソス[ソスフデソス[ソス^ソスノゑソスソスワゑソスソスB
        ($date,$name,$email,$comment) = split(/\,/,$line);
        #ソスRソスソスソスソスソスgソスマ撰ソスソスフ抵ソスソスフ会ソスソスsソスソスソスソスソスu\rソスvソスソスソスu<br>ソスvソスノ変奇ソスソスソスソスト、
        #ソスKソスソスメゑソスソスソスソスヘゑソスソスソスソスハゑソスノ表ソスソスソスソスソスワゑソスソスB
        $comment =~ s/\r/<br>/g;
        print "<table border=0 width=80% bgcolor=#FFFFFF>\n";
        print "<tr>\n";
        print "<td><font color=#000000>\n";
        #ソスソスソス[ソスソスソスAソスhソスソスソスXソスソスソスソスソスヘゑソスソスソストゑソスソスソスホソスソスソスソスNソスソスtソスソスソスワゑソスソスB
        if ($email ne "") {
          print "<a href=mailto:$email><strong>$name</strong></a>\n";
        } else { print "<strong>$name</strong>\n"; }
        print "  $date<br>\n";
        print "<blockquote>$comment</blockquote>\n";
        print "</font>\n";
        print "</td>\n";
        print "</tr>\n";
        print "</table>\n";
        print "<p>";
      }
      print "</center></div>\n";
      print "</body></html>\n";
      exit;
    }

  3. ソスfソス[ソス^ソスソスソスソスソスソスソスンソスソス[ソス`ソスソス
    sub regist {
      #ソスソスソスOソスソスソスAソスRソスソスソスソスソスgソスソスソスソスソスヘゑソスソスソストゑソスソスネゑソスソスソスホエソスソスソス[ソスソスソスoソスヘゑソスソスワゑソスソスB
      if ($FORM{'name'} eq "") { &error(bad_name); }
      if ($FORM{'comment'} eq "") { &error(bad_comment); }
      #ソスfソス[ソス^ソスtソス@ソスCソスソスソスソスヌ会ソスソスソスソス[ソスhソスIソス[ソスvソスソスソスソスソスト、ソスソスソスヘデソス[ソス^ソスソスソスナ鯉ソスフ行ソスノ追会ソスソスソスソスワゑソスソスB
      if (!open(NOTE,">>$rakugakifile")) { &error(bad_file); }
      $value = "$date_now\,$FORM{'name'}\,$FORM{'email'}\,$FORM{'comment'}\n";
      print NOTE $value;
      close(NOTE);
      #ソスヌ会ソスソスソスソスソスソスfソス[ソス^ソスソスソスuソスソスソスEソスUソスノ費ソスソスfソスソスソスソスソス驍スソス゚暦ソスソスソスソスソスソスソスソスソスソスソスソスソスソス[ソスhソスソスソスワゑソスソスB
      print "Location: $rakugakiurl" . '?' . "\n\n";
    }

  4. ソスGソスソスソス[ソスソスソスソス
    sub error {
      #ソスTソスuソスソスソス[ソス`ソスソスソスノ渡ソスソスソス黷スソスソスソスソスソスQソスニのゑソスソス゚の配ソスソス
      $error = $_[0];
      #ソスソスソスソスソスノゑソスソスGソスソスソス[ソスソスソスbソスZソス[ソスWソスフ撰ソスソスソス
      if ($error eq "bad_file") { $msg = 'ソスtソス@ソスCソスソスソスフオソス[ソスvソスソスソスAソスソスソスoソスヘに趣ソスソスsソスソスソスワゑソスソスソスソスB'; }
      elsif ($error eq "bad_name") { $msg = 'ソスjソスbソスNソスlソス[ソスソスソスソスソスLソスソスソスソスソスソストゑソスソスワゑソスソスソスB'; }
      elsif ($error eq "bad_comment") { $msg = 'ソスRソスソスソスソスソスgソスソスソスLソスソスソスソスソスソストゑソスソスワゑソスソスソスB'; }
      else { $msg = 'ソスソスソスソスソスsソスソスソスフエソスソスソス[ソスナ擾ソスソスソスソスソスソスpソスソスソスナゑソスソスワゑソスソスソスB'; }
      #ソスGソスソスソス[ソスソスソスbソスZソス[ソスWソス\ソスソスソスソスHTMLソスhソスLソスソスソスソスソスソスソスgソスフ撰ソスソスソス
      print "Content-type: text/html\n\n";
      print "<html><head><title>ソスソスソスソスソスソスソスソス</title></head>\n";
      print "<body bgcolor=#000000 text=#FFFFFF LINK=#FFAAAA VLINK=#FF8888>\n";
      print "<p>\n";
      print "<center><h2>error</h2><hr>\n";
      print "<i>" . $msg . "</i></hr></center>\n";
      print "</body></html>\n";
      exit;
    }
Copyright 2004 Terra. All rights reserved. No reproduction or republication without written