Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Urgent Help required with PERL CGI

by blue_cowdawg (Monsignor)
on Dec 24, 2012 at 15:46 UTC ( #1010204=note: print w/ replies, xml ) Need Help??


in reply to Urgent Help required with PERL CGI

      The values of variables present in my environment doesn't appear.. How to get the value of my local (not cgi variables) variables displayed through browser.

This comes as no surprise to me and as Corion and others have pointed out CGI usually runs as its own userid. For instance on Apache based web environments the userid can be one of but not limited to:

  • apache
  • httpd
  • web
  • www
  • www-data
  • www-user
  • nobody
  • noaccess
  • nofiles
with the last three given in descending order of likelihood in my experience. My own hosting environment that I rent out uses the same account as the person renting space. Makes my life much easier.

My advise to you is to never count on your personal account's environment to be available to you in a CGI script. When writing CGI I either hardcode what I need (not the ideal) or I set up a configuration file (better) with what I need. If you use FindBin to find where the script is running from and if your configuration file is in a directory related to where the script is being run you can easily open that configuration file and populate what you need to run the CGI.

Hope this helps...


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg


Comment on Re: Urgent Help required with PERL CGI

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1010204]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (12)
As of 2014-10-22 07:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (114 votes), past polls