diff options
author | Karl Williamson <public@khwilliamson.com> | 2012-07-15 17:02:19 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-07-19 09:39:06 -0600 |
commit | 43d3b06a68c324615c5d1909e183687a40b0bb19 (patch) | |
tree | e0864a1de120ff533165f22e6951a2a396e783aa /hv.c | |
parent | 5e61c969881a91ac25bbb01c162191a36b939373 (diff) | |
download | perl-43d3b06a68c324615c5d1909e183687a40b0bb19.tar.gz |
perlapi: Clarify hv_fetch() docs
I was confused by the earlier documentation. Thanks to Leon Timmermans
for clarifying, and to Vicent Pitt for most of the wording
Diffstat (limited to 'hv.c')
-rw-r--r-- | hv.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -277,7 +277,10 @@ negative the key is assumed to be in UTF-8-encoded Unicode. Returns the SV which corresponds to the specified key in the hash. The absolute value of C<klen> is the length of the key. If C<klen> is negative the key is assumed to be in UTF-8-encoded Unicode. If -C<lval> is set then the fetch will be part of a store. Check that the +C<lval> is set then the fetch will be part of a store. This means that if +there is no value in the hash associated with the given key, then one is +created and a pointer to it is returned. The C<SV*> it points to can be +assigned to. But always check that the return value is non-null before dereferencing it to an C<SV*>. See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for more |