1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Getting All the Environment Variables of the Server

Discussion in 'Perl' started by naveen, Jun 16, 2005.

  1. naveen

    naveen New Member

    Joined:
    Jun 2, 2005
    Messages:
    39
    Likes Received:
    1
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Calcutta, India
    Home Page:
    Below is a small Perl code that Shows all the environment variables of the Server on which it is run.

    Code:
    #!/usr/bin/perl 
       
       print "Content-type: text/html\n\n"; 
    
       print "<tt>\n"; 
       foreach $key (sort keys(%ENV)) 
       { 
          print "$key = $ENV{$key}<p>"; 
       } 
    just call the perl file containing he above code in the browser after setting the appropriate permissions.
     

Share This Page