use strict; use CGI; my $TITLE = 'Redirection Test'; my $cgi = new CGI; my $rp = $cgi->param('r'); print $cgi->header unless defined $rp; ... if (defined $rp) { if ($rp > 0) { my $full_url = $cgi->url(); # print $cgi->redirect($full_url"); print $cgi->header("Location: $full_url");exit(0); } } &print_html_header; &print_content; &print_end; exit(0); sub print_html_header { print $cgi->start_html($TITLE); } sub print_end { print $cgi->end_html; } sub print_content { print "
"; }