#!/usr/bin/perl use strict; use warnings; use CGI::Simple; my $baseurl = 'http://www.example.com/helps'; my %available_topics = ( home => 'home.html', user => 'user.html', add => 'add.html', update => 'update.html', remove => 'remove.html', #... other help topics ); my $default_topic = 'home'; my $cgi = CGI::Simple->new; # let CGI::Simple does the parsing my $topic = $cgi->param('topic') || ''; # get the wanted topic # get corresponding html file my $help_file = $available_topcs{$topic} || $available_topics{$default_topic}; # send redirection print $cgi->redirect("$baseurl/$help_file");