This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
RE: VERSION core
authorPaul Marquess <paul.marquess@btinternet.com>
Sat, 2 Mar 2002 22:50:44 +0000 (22:50 +0000)
committerAbhijit Menon-Sen <ams@wiw.org>
Sun, 3 Mar 2002 04:15:49 +0000 (04:15 +0000)
   From: "Paul Marquess" <paul_marquess@yahoo.co.uk>
   Message-Id: <AIEAJICLCBDNAAOLLOKLEEHNDOAA.paul_marquess@yahoo.co.uk>

p4raw-id: //depot/perl@14953

t/comp/use.t

index fb59777..e0281b4 100755 (executable)
@@ -5,7 +5,7 @@ BEGIN {
     @INC = '../lib';
 }
 
-print "1..27\n";
+print "1..28\n";
 
 my $i = 1;
 eval "use 5.000";      # implicit semicolon
@@ -168,3 +168,18 @@ print "ok ",$i++,"\n";
     }
     print "ok ",$i++,"\n";
 }
+
+
+{
+    # Regression test for patch 14937: 
+    #   Check that a .pm file with no package or VERSION doesn't core.
+    open F, ">xxx.pm" or die "Cannot open xxx.pm: $!\n";
+    print F "1;\n";
+    close F;
+    eval "use lib '.'; use xxx 3;";
+    unless ($@ =~ /^xxx defines neither package nor VERSION--version check failed at/) {
+       print "not ";
+    }
+    print "ok ",$i++,"\n";
+    unlink 'xxx.pm';
+}