From ab612ae322acd4d9f3012a98d8fef7a541ccdeca Mon Sep 17 00:00:00 2001 From: "Michael G. Schwern" Date: Sun, 3 Oct 1999 09:16:47 -0400 Subject: [PATCH] (Replaced by #4297.) To: perl5-porters@perl.org Subject: [PATCH av.c, perldiag.pod] Added field name to "No such array field" Message-ID: <19991003131647.A2816@blackrider> plus changed the error message to say "No such pseudo-hash field" as discussed in the above mail message. p4raw-id: //depot/cfgperl@4296 --- av.c | 5 +++-- pod/perldiag.pod | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/av.c b/av.c index 7201b49..6301043 100644 --- a/av.c +++ b/av.c @@ -630,10 +630,11 @@ Perl_avhv_fetch_ent(pTHX_ AV *av, SV *keysv, I32 lval, U32 hash) SV **indsvp; HV *keys = avhv_keys(av); HE *he; - + STRLEN n_a; + he = hv_fetch_ent(keys, keysv, FALSE, hash); if (!he) - Perl_croak(aTHX_ "No such array field"); + Perl_croak(aTHX_ "No such pseudo-hash field '%s'", SvPV(keysv,n_a)); return av_fetch(av, avhv_index_sv(HeVAL(he)), lval); } diff --git a/pod/perldiag.pod b/pod/perldiag.pod index d224a54..caf8886 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -1967,9 +1967,9 @@ your system. (F) The argument to B<-I> must follow the B<-I> immediately with no intervening space. -=item No such array field +=item No such pseudo-hash field '%s' -(F) You tried to access an array as a hash, but the field name used is +(F) You tried to access a pseudo-hash, but the field name used is not defined. The hash at index 0 should map all valid field names to array indices for that to work. -- 2.7.4