diff options
author | Tassilo von Parseval <tassilo.parseval@post.rwth-aachen.de> | 2003-12-06 12:50:59 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-12-06 19:50:07 +0000 |
commit | a3bcc51ebd4e201d85a37d8410b7a375b8d94244 (patch) | |
tree | 57797ca6128a5011622a6e805fb66f6d2a0fbaa5 /pp.c | |
parent | 5c98da1c029548d157089bc95672bf854902dd76 (diff) | |
download | perl-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.c')
-rw-r--r-- | pp.c | 10 |
1 files changed, 1 insertions, 9 deletions
@@ -106,15 +106,7 @@ PP(pp_padhv) RETURNOP(do_kv()); } else if (gimme == G_SCALAR) { - SV* sv = sv_newmortal(); - if (SvRMAGICAL(TARG) && mg_find(TARG, PERL_MAGIC_tied)) - Perl_croak(aTHX_ "Can't provide tied hash usage; " - "use keys(%%hash) to test if empty"); - if (HvFILL((HV*)TARG)) - Perl_sv_setpvf(aTHX_ sv, "%ld/%ld", - (long)HvFILL((HV*)TARG), (long)HvMAX((HV*)TARG) + 1); - else - sv_setiv(sv, 0); + SV* sv = Perl_hv_scalar((HV*)TARG); SETs(sv); } RETURN; |