From: Steffen Mueller Date: Sat, 2 Aug 2008 17:38:39 +0000 (+0200) Subject: Tiny SelfLoader patch for better warnings X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f9a01fbf80a2dfff95a408098b4f01fe2a12e140;p=p5sagit%2Fp5-mst-13.2.git Tiny SelfLoader patch for better warnings Message-ID: <20080802153839.9538.qmail@lists.develooper.com> Date: Sat, 02 Aug 2008 17:38:39 +0200 p4raw-id: //depot/perl@34170 --- diff --git a/lib/SelfLoader.pm b/lib/SelfLoader.pm index 5605c25..0288b2b 100644 --- a/lib/SelfLoader.pm +++ b/lib/SelfLoader.pm @@ -1,7 +1,7 @@ package SelfLoader; use 5.008; use strict; -our $VERSION = "1.15"; +our $VERSION = "1.16"; # The following bit of eval-magic is necessary to make this work on # perls < 5.009005. @@ -163,7 +163,8 @@ sub _add_to_cache { return () unless $fullname; carp("Redefining sub $fullname") if exists $Cache{$fullname}; - $Cache{$fullname} = join('', "package $pack; ",@$lines); + $Cache{$fullname} = join('', "\n\#line 1 \"sub $fullname\"\npackage $pack; ", @$lines); + #$Cache{$fullname} = join('', "package $pack; ",@$lines); print STDERR "SelfLoader cached $fullname: $Cache{$fullname}" if DEBUG; # return stub to be eval'd defined($protoype) ? "sub $fullname $protoype;" : "sub $fullname;"