Skip Menu |

This queue is for tickets about the Test-Trap CPAN distribution.

Report information
The Basics
Id: 61773
Status: resolved
Priority: 0/
Queue: Test-Trap

People
Owner: ebhanssen [...] allverden.no
Requestors: Ian.Goodacre [...] xtra.co.nz
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: v0.2.1
Fixed in: (no value)



Subject: return from trap function
It would be nice if the documentation defined the return from the trap function.
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
I have at long last made a new release, incorporating this documentation. Sorry it took so long.