I know what they all do, but have never found myself in a situation where I've needed any of them. I've used BEGIN
blocks on many occasions and END
s once in a while. BEGIN
is especially useful when you need to tweak the environment before code gets run, and I've used END
in certain debugging situations to trap important state information for hard-to-track-down fatal errors.
Have you ever used CHECK
, UNITCHECK
or INIT
? If so, what for? And would a BEGIN
block not have sufficed for some reason?
The documentation for the blocks is on PerlDoc.