Change 14937 by jhi@alpha on 2002/03/01 23:00:08

        Subject: RE: VERSION core
        From: "Paul Marquess" <[EMAIL PROTECTED]>
        Date: Fri, 1 Mar 2002 23:47:48 -0000
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

.... //depot/perl/pod/perldiag.pod#276 edit
.... //depot/perl/universal.c#44 edit

Differences ...

==== //depot/perl/pod/perldiag.pod#276 (text) ====
Index: perl/pod/perldiag.pod
--- perl/pod/perldiag.pod.~1~   Fri Mar  1 16:15:05 2002
+++ perl/pod/perldiag.pod       Fri Mar  1 16:15:05 2002
@@ -1223,6 +1223,11 @@
 checks for an undefined I<scalar> value.  If you want to see if the hash
 is empty, just use C<if (%hash) { # not empty }> for example.
 
+=item %s defines neither package nor VERSION--version check failed
+
+(F) You said something like "use Module 42" but in the Module file
+there are neither package declarations nor a C<$VERSION>.
+
 =item Delimiter for here document is too long
 
 (F) In a here document construct like C<<<FOO>, the label C<FOO> is too
@@ -1266,6 +1271,11 @@
 
 See Server error.
 
+=item %s does not define %s::VERSION--version check failed
+
+(F) You said something like "use Module 42" but the Module did not
+define a C<$VERSION.>
+
 =item Don't know how to handle magic of type '%s'
 
 (P) The internal handling of magical variables has been cursed.

==== //depot/perl/universal.c#44 (text) ====
Index: perl/universal.c
--- perl/universal.c.~1~        Fri Mar  1 16:15:05 2002
+++ perl/universal.c    Fri Mar  1 16:15:05 2002
@@ -290,10 +290,18 @@
        STRLEN len;
        SV *req = ST(1);
 
-       if (undef)
-           Perl_croak(aTHX_ "%s does not define $%s::VERSION--version check failed",
-                      HvNAME(pkg), HvNAME(pkg));
+       if (undef) {
+            if (pkg)
+                 Perl_croak(aTHX_
+                            "%s does not define $%s::VERSION--version check failed",
+                            HvNAME(pkg), HvNAME(pkg));
+            else {
+                 char *str = SvPVx(ST(0), len);
 
+                 Perl_croak(aTHX_
+                            "%s defines neither package nor VERSION--version check 
+failed", str);
+            }
+       }
        if (!SvNIOK(sv) && SvPOK(sv)) {
            char *str = SvPVx(sv,len);
            while (len) {
End of Patch.

Reply via email to