From: gfx Date: Fri, 15 Jan 2010 05:39:22 +0000 (+0900) Subject: Clearify the issue on RT#69939 X-Git-Tag: 0.47~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=commitdiff_plain;h=5f69227097e1e60f2bd31a9f5d71f5a344e6cbc5;hp=13756394019ebd1535c45fdca817887ce6a0b122 Clearify the issue on RT#69939 --- diff --git a/caveats/RT69939.t b/caveats/RT69939.t index d6bb172..c13fb69 100644 --- a/caveats/RT69939.t +++ b/caveats/RT69939.t @@ -11,13 +11,11 @@ use Test::More; is => 'rw', default => sub{ - # Those eval()s which try to load missing modules in - # compile-time triggers a Perl bug (Ticket #69939). - # This is related not only to Mouse, but also to tie-modules. + # Ticket #69939 + # See the Mouse manpage - #eval 'use MayNotBeInstalled'; # NG - #eval 'BEGIN{ require MayNotBeInstalled }'; # NG - eval{ eval 'use MayNotBeInstalled' }; # OK + #eval 'BEGIN{ die }'; # NG + eval{ eval 'BEGIN{ die }' }; # OK ::pass 'in a default callback'; }, ); diff --git a/lib/Mouse.pm b/lib/Mouse.pm index 279d58c..b8b4565 100644 --- a/lib/Mouse.pm +++ b/lib/Mouse.pm @@ -404,15 +404,16 @@ keywords (such as L) it will break loudly instead breaking subtly. =head1 CAVEATS -If you use Mouse::XS you might see a silent fatal error when you use -callbacks which include C. This is not +If you use Mouse::XS you might see a fatal error on callbacks +which include C, which typically occurs in sutch code +like C. This is not a bug in Mouse. In fact, it is a bug in Perl (RT #69939). To work around this problem, surround C with C: sub callback { - # eval 'use MayNotBeInstalled'; # NG - eval{ eval 'use MayNotBeInstalled' }; # OK + # eval 'use NotInstalledModule'; # NG + eval{ eval 'use NotInstalledModule' }; # OK } It seems ridiculous, but it works as you expected.