in reply to Re: Access to Windows Environment Variables
in thread Access to Windows Environment Variables
Put this in your webserver's document root. I called it "env.pl", so access it by:#!C:\Perl\bin use strict; ######## Start the HTML ######## print <<END_HTML; <html> <head> <title>Perl CGI Environment Variables</title> <STYLE type="text/css"> <!-- H1.page_title {text-align: center; color: blue} --> </STYLE> </head> <body> <h1 class="page_title">Perl CGI Environment Variables</h1> <table border="1"> <tr> <th bgcolor="#99ccff">\@INC Paths</th> </tr> END_HTML ### 1st print out the @INC array ### my $ct = 0; foreach my $dir (@INC) { print <<END_HTML; <tr> <td><b>$dir</b></td> </tr> END_HTML $ct++; } ######## Finish the @INC HTML ######### print <<END_HTML; </table> <br> <br> <table border="1"> <tr> <th bgcolor="#99ccff">Env Variable Name</th> <th bgcolor="#99ccff">Value</th> </tr> END_HTML ### Next print out all the environment variables ### foreach my $name (sort keys %ENV) { print <<END_HTML; <tr> <td><b>$name</b></td> <td>$ENV{$name}</td> </tr> END_HTML } ######## Finish the HTML ######### print <<END_HTML; </table> </body> </html> END_HTML
and see what environment variables it displays.http://your.server.com/env.pl
HTH.
|
|---|