The types are:
SVt_NULL
- SVt_BIND (unused)
SVt_IV
SVt_NV
SVt_RV
typedef enum {
SVt_NULL, /* 0 */
- SVt_BIND, /* 1 */
+ SVt_DUMMY, /* 1 */
SVt_IV, /* 2 */
SVt_NV, /* 3 */
/* RV was here, before it was merged with IV. */
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.
#define SvTRUE_common(sv,fallback) ( \
!SvOK(sv) \
? 0 \
- : (SvFLAGS(sv) & (SVf_POK|SVf_IOK|SVf_NOK)) \
- ? ( (SvPOK(sv) && SvPVXtrue(sv)) \
- || (SvIOK(sv) && SvIVX(sv) != 0) \
+ : SvPOK(sv) \
+ ? SvPVXtrue(sv) \
+ : (SvFLAGS(sv) & (SVf_IOK|SVf_NOK)) \
+ ? ( (SvIOK(sv) && SvIVX(sv) != 0) \
|| (SvNOK(sv) && SvNVX(sv) != 0.0)) \
: (fallback))