--- Guard/Guard.pm 2008/12/13 17:37:22 1.1 +++ Guard/Guard.pm 2008/12/13 17:49:12 1.2 @@ -16,6 +16,11 @@ objects, which execute a given code block when destroyed, and scoped guards, which are tied to the scope exit. +=head1 FUNCTIONS + +This module currently exports the C and C functions by +default. + =over 4 =cut @@ -40,6 +45,10 @@ Registers a block that is executed when the current scope (block, function, method, eval etc.) is exited. +The description below sounds a bit complicated, but that's just because +C tries to get even corner cases "right": the goal is to +provide you with a rock solid clean up tool. + This is similar to this code fragment: eval ... code following scope_guard ... @@ -48,6 +57,7 @@ eval BLOCK; eval { $Guard::DIED->() } if $@; } + die if $@; Except it is much faster, and the whole thing gets executed even when the BLOCK calls C, C, C or escapes via other means.