#!/usr/bin/perl
use CGI;
my $cgi = new CGI;
print $cgi->header();
print("Created CGI.
\n");
printCgi($cgi);
$cgi->path_info("/pathinfo1");
print("Set path_info to \"/pathinfo1\".
\n");
printCgi($cgi);
sub printCgi(){
my $cg = shift;
print("******************************************************************
\n");
print(" URL: ".$cg->url(-path_info=>1,-relative=>0,-query=>1)."
\n");
print("path_info(): ".$cg->path_info()."
\n");
print("******************************************************************
\n");
}
####
Created CGI.
******************************************************************
URL: http://servername/cgi-bin/cgitest.cgi/AAAA
path_info(): /AAAA
******************************************************************
Set path_info to "/pathinfo1".
******************************************************************
URL: http://servername/cgi-bin/cgitest.cgi/pathinfo1
path_info(): /pathinfo1
******************************************************************
####
Created CGI.
******************************************************************
URL: http://servername/cgi-bin/cgitest.cgi/AAAA
path_info(): /AAAA
******************************************************************
Set path_info to "/pathinfo1".
******************************************************************
URL: http://servername/cgi-bin/cgitest.cgi/AAAA/pathinfo1
path_info(): /pathinfo1
******************************************************************