#!/opt/gnu/bin/perl



local (*in) = @_ if @_;
local ($i, $key, $val);
$in = $ENV{'QUERY_STRING'};
@in = split(/[&;]/,$in);
foreach $i (0 .. $#in) {
  #=convert plus's to spaces===
    $in[$i] =~ s/\+/ /g;
  #=split into key and value===
    ($key, $val) = split(/=/,$in[$i],2);
  #=convert from hex to alpha==
    $key =~ s/%(..)/pack("c",hex($1))/ge;
    $val =~ s/%(..)/pack("c",hex($1))/ge;
  #=associate key and value====
    $in{$key} .= "\0" if (defined($in{$key}));
    $in{$key} .= $val;
    }

  $s_url_temp = $in{'S_URL'};
  ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)=gmtime;

#=now print to file
  $fileName = "outbox/access.txt";
  open(FH1,">> $fileName") || die "Can't Open: ";
  print FH1 "$mon/$mday/$year\t$in{'D_URL'}\t$ENV{'REMOTE_HOST'}\t$s_url_temp\t$in{'MGID'}\t$in{'ID'}\n";

print "location: $in{'D_URL'}\n\n";

