summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorPali <pali@cpan.org>2019-06-17 14:09:08 +0200
committerTony Cook <tony@develop-help.com>2019-06-19 10:21:36 +1000
commit3127113cbf175740dce688a3320c9d62ece9b910 (patch)
tree3014a93c62c1dfa70e6412ac461d87ab87e55b16 /sv.h
parentda1830f5b059251a3031add1d03b8a965ab2c773 (diff)
downloadperl-3127113cbf175740dce688a3320c9d62ece9b910.tar.gz
Document SvTRUEx() macro
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/sv.h b/sv.h
index 637cd14dc0..15adf03449 100644
--- a/sv.h
+++ b/sv.h
@@ -1601,10 +1601,21 @@ false. See C<L</SvOK>> for a defined/undefined test. Handles 'get' magic
unless the scalar is already C<SvPOK>, C<SvIOK> or C<SvNOK> (the public, not the
private flags).
+See C<L</SvTRUEx>> for a version which guarantees to evaluate C<sv> only once.
+
=for apidoc Am|bool|SvTRUE_nomg|SV* sv
Returns a boolean indicating whether Perl would evaluate the SV as true or
false. See C<L</SvOK>> for a defined/undefined test. Does not handle 'get' magic.
+=for apidoc Am|bool|SvTRUEx|SV* sv
+Returns a boolean indicating whether Perl would evaluate the SV as true or
+false. See C<L</SvOK>> for a defined/undefined test. Handles 'get' magic
+unless the scalar is already C<SvPOK>, C<SvIOK> or C<SvNOK> (the public, not the
+private flags).
+
+This form guarantees to evaluate C<sv> only once. Only use this if C<sv> is an
+expression with side effects, otherwise use the more efficient C<SvTRUE>.
+
=for apidoc Am|char*|SvPVutf8_force|SV* sv|STRLEN len
Like C<SvPV_force>, but converts C<sv> to UTF-8 first if necessary.