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

Re: BEGIN { } block

by ggvaidya (Pilgrim)
on Aug 09, 2009 at 10:48 UTC ( #787154=note: print w/replies, xml ) Need Help??

in reply to BEGIN { } block

Remember that use statements are implicitly emBEGINned - they're evaluated as soon as perl understands that they're there. So BEGIN blocks are actually evaluated not just when use is used, but before any other (non-BEGIN) code executes at all.

I've written a web application which uses BEGIN {} blocks to set up signal handlers for die()/warn() calls to do various site-specific stuff with them (like e-mailing the errors to the system admin so he knows there's problem afoot, and silencing warnings on the production site but making them fatal otherwise).

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2019-05-23 21:38 GMT
Find Nodes?
    Voting Booth?
    Do you enjoy 3D movies?

    Results (146 votes). Check out past polls.

    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!