Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: %ENV in a .pm versus .cgi ?

by moritz (Cardinal)
on Jun 17, 2014 at 18:35 UTC ( [id://1090188]=note: print w/replies, xml ) Need Help??


in reply to %ENV in a .pm versus .cgi ?

Update: I've completely replaced my answer; find the old one in readmore tags below.

Imagine you were a scientist. You research the question whether a new web server caused some changes, or if it was the code organization (or both, or neither of these reasons).

As a scientist, it's your duty to design and run an experiment to decide that question. And since you are a lazy scientist, you chose the simplest experiment that you can think of. Not only does that mean you have less work doing the experiment, but it also means you don't have to write so much when you submit your paper for review.

So, which experiment could you do? A quick brainstorming:

  • Run the old code on the new webserver. If it works, the webserver is to blame.
  • Run the new code on the old webserver. If it works, the webserver is to blame.
  • Dump and inspect the contents of %ENV in the top-level CGI script on the new webserver (not in the module
  • Ask on perlmonks

It really depends on your setup if the first two possible experiments are simple, but the third one certainly is.

The fourth has the problem that perlmonks doesn't know your problem too well, and even if they solve the problem for you, you can't submit your paper in the end.

Want to debug your code? Think like a scientist. Start now!

Old answer:

%ENV is a global variable, which means it's identical in all parts of your process (except when localized somewhere).

That makes it likely that the new server is to blame. Just dump %ENV on the new server in the top-level CGI script, and see if it's what you expected. Then you'll know if the new server or the module boundary is responsible.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-03-28 09:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found