#!/usr/local/bin/perl print "Content-type: text/html\n\n"; # 初期値読み $query = "?".$ENV{'QUERY_STRING'} if $ENV{'QUERY_STRING'} ne ""; # Get FORM data ... %form = &read_input; $bred=$form{'bred'}; $bgreen=$form{'bgreen'}; $bblue=$form{'bblue'}; $tred=$form{'tred'}; $tgreen=$form{'tgreen'}; $tblue=$form{'tblue'}; print < Color Table

Automate color GIF image


Background Color (Decimal 0-255)

Red Gree Blue

Text Color (Decimal 0-255)

Red Gree Blue

EOD # sub read_input { local ($buffer, @pairs, $pair, $name, $value, %FORM); # Read in text $ENV{'REQUEST_METHOD'} =~ tr/a-z/A-Z/; if ($ENV{'REQUEST_METHOD'} eq "POST") { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); } else { $buffer = $ENV{'QUERY_STRING'}; } @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%(..)/pack("C", hex($1))/eg; $FORM{$name} = $value; } %FORM; }