#!/usr/bin/perl -wT
use strict;
use CGI qw(:standard);

if (index($ENV{HTTP_REFERER}, "http://www.cgi101.com") < 0) {
   print redirect("http://www.cgi101.com/book/ch10/");
   exit;
}

print header;
print start_html("Environment");

foreach my $key (sort(keys(%ENV))) {
  print "$key = $ENV{$key}<br>\n";
}

print end_html;