summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorTassilo von Parseval <tassilo.parseval@post.rwth-aachen.de>2003-12-06 12:50:59 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-12-06 19:50:07 +0000
commita3bcc51ebd4e201d85a37d8410b7a375b8d94244 (patch)
tree57797ca6128a5011622a6e805fb66f6d2a0fbaa5 /pp_hot.c
parent5c98da1c029548d157089bc95672bf854902dd76 (diff)
downloadperl-a3bcc51ebd4e201d85a37d8410b7a375b8d94244.tar.gz
SCALAR/FIRSTKEY for tied hashes in scalar context
Message-id: <20031206105059.GA13989@ethan> p4raw-id: //depot/perl@21855
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/pp_hot.c b/pp_hot.c
index efc7a27071..d8ccf6d4c3 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -901,15 +901,7 @@ PP(pp_rv2hv)
}
else if (gimme == G_SCALAR) {
dTARGET;
- if (SvRMAGICAL(hv) && mg_find((SV *)hv, PERL_MAGIC_tied))
- Perl_croak(aTHX_ "Can't provide tied hash usage; "
- "use keys(%%hash) to test if empty");
- if (HvFILL(hv))
- Perl_sv_setpvf(aTHX_ TARG, "%"IVdf"/%"IVdf,
- (IV)HvFILL(hv), (IV)HvMAX(hv) + 1);
- else
- sv_setiv(TARG, 0);
-
+ TARG = Perl_hv_scalar(hv);
SETTARG;
}
RETURN;