diff options
author | Nicholas Clark <nick@ccl4.org> | 2001-04-26 01:00:54 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-04-25 22:33:17 +0000 |
commit | 7f4f6dafffd5d5d35d318217d91a454a993e6d94 (patch) | |
tree | cc033f1bd57a3bda89fa51aa32995a2387d1d660 /lib/Devel | |
parent | 78ad9108a21eee2b26e0d459b81a566d11b0f4e5 (diff) | |
download | perl-7f4f6dafffd5d5d35d318217d91a454a993e6d94.tar.gz |
test for Devel::SelfStubber
Message-ID: <20010426000054.D89026@plum.flirble.org>
p4raw-id: //depot/perl@9845
Diffstat (limited to 'lib/Devel')
-rw-r--r-- | lib/Devel/SelfStubber.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Devel/SelfStubber.pm b/lib/Devel/SelfStubber.pm index 8a3a76eb37..ba833ff70e 100644 --- a/lib/Devel/SelfStubber.pm +++ b/lib/Devel/SelfStubber.pm @@ -3,7 +3,7 @@ require SelfLoader; @ISA = qw(SelfLoader); @EXPORT = 'AUTOLOAD'; $JUST_STUBS = 1; -$VERSION = '1.02'; +$VERSION = 1.03; sub Version {$VERSION} # Use as @@ -34,13 +34,17 @@ sub stub { $mod_file = "$lib/$mod_file.pm"; $fh = "${module}::DATA"; + my (@BEFORE_DATA, @AFTER_DATA); + @DATA = @STUBS = (); open($fh,$mod_file) || die "Unable to open $mod_file"; + local $/ = "\n"; while(defined ($line = <$fh>) and $line !~ m/^__DATA__/) { push(@BEFORE_DATA,$line); $line =~ /use\s+SelfLoader/ && $found_selfloader++; } - $line =~ m/^__DATA__/ || die "$mod_file doesn't contain a __DATA__ token"; + (defined ($line) && $line =~ m/^__DATA__/) + || die "$mod_file doesn't contain a __DATA__ token"; $found_selfloader || print 'die "\'use SelfLoader;\' statement NOT FOUND!!\n"',"\n"; $self->_load_stubs($module); |