From: gfx Date: Tue, 27 Oct 2009 02:19:09 +0000 (+0900) Subject: Hack for XSLoader X-Git-Tag: 0.40_02~23 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=34bdc46af065df1aa23fefd987f02e7e1856e87e;p=gitmo%2FMouse.git Hack for XSLoader --- diff --git a/lib/Mouse/Util.pm b/lib/Mouse/Util.pm index a5678b9..949b654 100644 --- a/lib/Mouse/Util.pm +++ b/lib/Mouse/Util.pm @@ -11,7 +11,13 @@ BEGIN{ if(!$need_pp && !exists $INC{'Mouse/PurePerl.pm'}){ local $@; - $need_pp = !eval{ + + # XXX: XSLoader tries to get the object path from caller's file name + # $hack_mouse_file fools its mechanism + + (my $hack_mouse_file = __FILE__) =~ s/.Util//; # .../Mouse/Util.pm -> .../Mouse.pm + print "$hack_mouse_file\n"; + $need_pp = !eval sprintf("#line %d %s\n", __LINE__, $hack_mouse_file) . q{ require XSLoader; XSLoader::load('Mouse', $VERSION); };