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:
    http://naveenhere.blogspot.com
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice