Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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

by moritz (Cardinal)
on Jun 17, 2014 at 18:35 UTC ( #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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1090188]
[stevieb]: so, it's -34c today, and some of my water pipes are frozen and one burst. sigh
[stevieb]: it doesn't seem as though "there's an app for that"
[ambrus]: burst water pipe sucks
[Corion]: ambrus: Ugh - yes, that really sucks!
[stevieb]: good thing is that both sides of the break are completely frozen, so I was able to shut off the water to the building before any water leaks. I told the landlord last year to insulate that specific area better
[Corion]: stevieb: Our SV overlords don't know what "frozen pipe" means and think it's something like "frozen yogurt"

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (11)
As of 2016-12-08 18:05 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (144 votes). Check out past polls.