PERL   18

demo CGI program

Guest on 10th July 2022 07:56:17 PM

  1. #!/usr/bin/perl
  2. ##
  3. ##  printenv -- demo CGI program which just prints its environment
  4. ##
  5.  
  6. #!/usr/bin/perl
  7. #!c:/Perl/bin/Perl.exe
  8. # swap the first line and second line if the script runs on the Windows
  9.  
  10.  
  11. BEGIN {
  12.     my $b__dir = (-d '/home/loyaltyh/perl'?'/home/loyaltyh/perl':( getpwuid($>) )[7].'/perl');
  13.     unshift @INC,$b__dir.'5/lib/perl5',$b__dir.'5/lib/perl5/x86_64-linux-thread-multi',map { $b__dir . $_ } @INC;
  14. }
  15.  
  16.  
  17.  
  18.  
  19. print "Content-type: text/plain\n\n";
  20. foreach $var (keys(%ENV)) {
  21.         $value = $ENV{$var};
  22.         print "$var=\"$value\"\n";
  23. }

Raw Paste


Login or Register to edit or fork this paste. It's free.