diff options
author | David Mitchell <davem@iabyn.com> | 2013-05-09 16:57:56 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2013-05-09 17:05:15 +0100 |
commit | fe02ddb7a070fc75fab3f7c2ed77f31b0dc5fc23 (patch) | |
tree | d687c9a5ff614c92927f1b1b7a7a51d3b74aea5d | |
parent | ae3a5aada640c0fa13263cd8a0bf164eb98bc37c (diff) | |
download | perl-fe02ddb7a070fc75fab3f7c2ed77f31b0dc5fc23.tar.gz |
further tweak SvPV() docs
Make it clear that a different pointer may be returned each time.
-rw-r--r-- | sv.h | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -1490,11 +1490,13 @@ stringified version becoming C<SvPOK>. Handles 'get' magic. See also C<SvPVx> for a version which guarantees to evaluate sv only once. Note that there is no guarantee that the return value of C<SvPV()> is -equal to C<SvPVX(sv)> (or even that C<SvPVX(sv)> contains valid data), due -to the way that things like overloading and Copy-On-Write are handled. In -these cases, the return value may point to a temporary buffer or similar. -If you absolutely need the SvPVX field to be valid (for example, if you -intend to write to it), then see L</SvPV_force>. +equal to C<SvPVX(sv)>, or that C<SvPVX(sv)> contains valid data, or that +successive calls to C<SvPV(sv)) will return the same pointer value each +time. This is due to the way that things like overloading and +Copy-On-Write are handled. In these cases, the return value may point to +a temporary buffer or similar. If you absolutely need the SvPVX field to +be valid (for example, if you intend to write to it), then see +L</SvPV_force>. =for apidoc Am|char*|SvPVx|SV* sv|STRLEN len A version of C<SvPV> which guarantees to evaluate C<sv> only once. |