#! /usr/bin/perl use strict; use warnings; require LWP::Simple; require HTTP::Date; require URI::Escape; $|=1; my $BASE; if (exists $ENV{"QUERY_STRING"}) { $BASE=($ENV{"QUERY_STRING"}=~m{^url=([^&]*)})[0]; $BASE=URI::Escape::uri_unescape($BASE); 0==@ARGV or die "ARGV count != 0"; $BASE||=""; } else { 1==@ARGV or die "ARGV count != 1"; $BASE=$ARGV[0]; } # Somehow Perl modules started reencoding windows-1250 -> utf-8. if ($ENV{"GATEWAY_INTERFACE"}) { my $future=HTTP::Date::time2str(2000000000); my $past =HTTP::Date::time2str(1000000000); print <<"EOH"; Content-type: text/html; charset=utf-8 Cache-Control: public Expires: $future Last-Modified: $past EOH } print <<"EOH";