home *** CD-ROM | disk | FTP | other *** search
/ PC World 2003 May / PCWorld_2003-05_cd.bin / Komunik / apache / apache_2.0.45-win32-x86-no_ssl.msi / Data.Cab / F48458_printenv.pl < prev    next >
Perl Script  |  2003-04-01  |  288b  |  14 lines

  1. #!c:/Perl/bin/Perl.exe
  2. ##
  3. ##  printenv -- demo CGI program which just prints its environment
  4. ##
  5.  
  6. print "Content-type: text/plain\n\n";
  7. foreach $var (sort(keys(%ENV))) {
  8.     $val = $ENV{$var};
  9.     $val =~ s|\n|\\n|g;
  10.     $val =~ s|"|\\"|g;
  11.     print "${var}=\"${val}\"\n";
  12. }
  13.  
  14.