Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1010204]
[Discipulus]: shmem the first time I was in germany I was so smart to learn by heart the address of the hostel: Einbahnstraße..
[Discipulus]: james28909 you are welcome
james28909 doesnt drink much alcohol
james28909 does enjoy blazing up though
james28909 also walks around hunting for his cell phone while using its flashlight function

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2018-05-20 16:14 GMT
Find Nodes?
    Voting Booth?