summaryrefslogtreecommitdiff
path: root/universal.c
diff options
context:
space:
mode:
authorPaul Marquess <paul.marquess@btinternet.com>2002-03-01 23:47:48 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-03-01 23:00:08 +0000
commit62658f4d9934aba5f8b23afcc078dc12b3a40223 (patch)
tree7ce7fc3cff094cf0f9554a334a0848478ff83a42 /universal.c
parent506faf56dfc5fbabb52996eac45fa2d064bcf4ba (diff)
downloadperl-62658f4d9934aba5f8b23afcc078dc12b3a40223.tar.gz
RE: VERSION core
From: "Paul Marquess" <paul_marquess@yahoo.co.uk> Message-ID: <AIEAJICLCBDNAAOLLOKLEEGMDOAA.paul_marquess@yahoo.co.uk> p4raw-id: //depot/perl@14937
Diffstat (limited to 'universal.c')
-rw-r--r--universal.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/universal.c b/universal.c
index 8fe67b91d2..d629dfd1c9 100644
--- a/universal.c
+++ b/universal.c
@@ -290,10 +290,18 @@ XS(XS_UNIVERSAL_VERSION)
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) {