PERL   31

printenv

Guest on 20th June 2022 05:57:42 AM

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

Raw Paste


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