On Wed Sep 29 15:50:17 2010, iang wrote:
Show quoted text> It would be nice if the documentation defined the return from the trap
> function.
I've checked in the appended. Nice enough. :)
Index: Trap.pm
===================================================================
--- Trap.pm (revision 237)
+++ Trap.pm (revision 238)
@@ -354,6 +354,12 @@
queried through the trap object, which is by default exported as
C<$trap>, but can be exported by any name.
+The value returned from C<trap> mimics that returned from C<eval>: If
+the I<BLOCK> would die or exit, it returns an undefined value in
+scalar context or an empty list in list context; otherwise it returns
+whatever the I<BLOCK> would return in the given context (also
+available as the trapped return values).
+
=head1 TRAP LAYERS
Exactly what the C<trap> traps depends on the layers of the trap. It