#!/usr/local/bin/perl -w my $DEBUG = 0; use strict; my @pref = ("en","es","de","fr"); my $page = $ENV{QUERY_STRING}; my @lang = split(",",$ENV{HTTP_ACCEPT_LANGUAGE}); my $langList = makeList (@lang); my @accept = split(",",$ENV{HTTP_ACCEPT}); my $acceptList = makeList (@accept); my @agent = split(/\d /,$ENV{HTTP_USER_AGENT}); my $agentList = makeList (@agent); showHTML() if $DEBUG > 0; makeJump() if $DEBUG == 0; sub makeJump { print "Pragma: no-cache\n"; print "Location: $page.$lang[0]\n\n"; } sub showHTML { print < Browser Info Accept: $ENV{HTTP_ACCEPT}
    $acceptList
Language: $ENV{HTTP_ACCEPT_LANGUAGE}
    $langList
Agent: $ENV{HTTP_USER_AGENT} HTML makeJump(); print < HTML } sub makeList { my (@list) = @_; my $strList = ""; foreach (@list) { $strList .= "
  • $_\n"; } return $strList; }