Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Unique testing problem

by adrianh (Chancellor)
on May 24, 2003 at 11:19 UTC ( [id://260559]=note: print w/replies, xml ) Need Help??


in reply to Re: Unique testing problem
in thread Unique testing problem

So you better go along the lines of BazB's suggestion, as an exit would kill your mod_perl on a webserver

Nobody's mentioned mod_perl :-)

Also, since perl 5.6, mod_perl overrides exit behind the scenes so it's often a non-issue.

No need to fumble with exit here. Just just die and return reasonable stuff. See SIGDIE by Adam for an elaboration on that.

I would not recommend using a __DIE__ handler in mod_perl code. It's global nature causes problems if you need to support multiple applications, virtual hosts, etc.

Alternative Exception Handling Techniques in the mod_perl guide has more info on this.

Personally, if there was the opportunity, I would probably try to refactor the code so that there were not multiple exit points for the program, rather than throwing exceptions into the mix. Multiple exit points are a Code Smell in my experience.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-24 04:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found