Perl in a Nutshell

Perl in a NutshellSearch this book
Previous: 9.2 URL EncodingChapter 9
CGI Overview
Next: 9.4 CGI Environment Variables
 

9.3 Extra Path Information

In addition to passing query strings, you can pass additional data, known as extra path information, as part of the URL. The server gauges where the CGI program name ends; anything following is deemed "extra" and is stored in the environment variable PATH_INFO. The following line calls a script with extra path information:

http://some.machine/cgi-bin/display.pl/cgi/cgi_doc.txt
In this example, we use a script with a .pl suffix to make it clear where the CGI program's path ends and the extra path information begins. Everything after display.pl is the extra path and is placed in the PATH_INFO environment variable. The PATH_TRANSLATED variable is also set, mapping the PATH_INFO to the DOCUMENT_ROOT directory (e.g., /usr/local/etc/httpd/public/cgi/cgi_doc.txt).


Previous: 9.2 URL EncodingPerl in a NutshellNext: 9.4 CGI Environment Variables
9.2 URL EncodingBook Index9.4 CGI Environment Variables

Library Navigation Links

Copyright © 2001 O'Reilly & Associates. All rights reserved.