Tiny SelfLoader patch for better warnings
authorSteffen Mueller <wyp3rlx02@sneakemail.com>
Sat, 2 Aug 2008 17:38:39 +0000 (19:38 +0200)
committerNicholas Clark <nick@ccl4.org>
Mon, 4 Aug 2008 09:38:35 +0000 (09:38 +0000)
Message-ID: <20080802153839.9538.qmail@lists.develooper.com>
Date: Sat, 02 Aug 2008 17:38:39 +0200

p4raw-id: //depot/perl@34170

lib/SelfLoader.pm

index 5605c25..0288b2b 100644 (file)
@@ -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;"