#!/usr/bin/perl
#
# JUMP.CGI - jump to a Web page selected from a listbox in an HTML form.
# Written from scratch, but inspired by Selena Sol's form_processor.cgi.
# Copyright (c) 1999 by Jeremy Malcolm <Jeremy@Malcolm.wattle.id.au> and
# Terminus Network Services.  Download from http://malcolm.wattle.id.au.
# Distribute and modify this script under the same terms as Perl itself.
#
# Installation: Copy script to your cgi-bin directory (or as applicable)
# and chmod to 755.  Modify first line to point to your perl executable.
#
# Usage: include a listbox named "page" in your document with the URL of
# each page listed as the value.  The URL may be relative to the cgi-bin
# directory (not the directory of the HTML document) or may be absolute.
#
# System requirements: Perl 5, CGI.pm module (standard with Perl 5.004).
#

use CGI qw(param); # import CGI shortcut - just the one we need!
use LWP::Simple; # import WWW shortcuts - only the simplest!
$| = 1; # flush perl's buffer otherwise page won't fully display
$page = param("page") || die "This script requires a \"page\" argument.";
print "Content-type: text/html\n";
print "Location: $page\n\n";
getprint($page);
