The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

Creates a new SV, of the type specified. The reference count for the new SV is set to 1.

Creates a new mortal SV, of the type specified. The reference count for the new SV is set to 1.

This is equivalent to SV* sv = sv_2mortal(newSV_type(<some type>)) and SV* sv = sv_newmortal(); sv_upgrade(sv, <some_type>) but should be more efficient than both of them. (Unless sv_2mortal is inlined at some point in the future.)

Returns a boolean as to whether or not sv contains a PV that is considered TRUE. FALSE is returned if sv doesn't contain a PV, or if the PV it does contain is zero length, or consists of just the single character '0'. Every other PV value is considered TRUE.

As of Perl v5.37.1, sv is evaluated exactly once; in earlier releases, it could be evaluated more than once.

Indicate that sv has overloading (active magic) enabled.

Indicate that sv has overloading (active magic) disabled.

These each coerce the given SV to IV and return it. The returned value in many circumstances will get stored in sv's IV slot, but not in all cases. (Use "sv_setiv" to make sure it does).

As of 5.37.1, all are guaranteed to evaluate sv only once.

SvIVx is now identical to SvIV, but prior to 5.37.1, it was the only form guaranteed to evaluate sv only once.

SvIV_nomg is the same as SvIV, but does not perform 'get' magic.

These each coerce the given SV to NV and return it. The returned value in many circumstances will get stored in sv's NV slot, but not in all cases. (Use "sv_setnv" to make sure it does).

As of 5.37.1, all are guaranteed to evaluate sv only once.

SvNVx is now identical to SvNV, but prior to 5.37.1, it was the only form guaranteed to evaluate sv only once.

SvNV_nomg is the same as SvNV, but does not perform 'get' magic.

These each coerce the given SV to UV and return it. The returned value in many circumstances will get stored in sv's UV slot, but not in all cases. (Use "sv_setuv" to make sure it does).

As of 5.37.1, all are guaranteed to evaluate sv only once.

SvUVx is now identical to SvUV, but prior to 5.37.1, it was the only form guaranteed to evaluate sv only once.

Creates an RV wrapper for an SV. The reference count for the original SV is not incremented.