1Internals(3pm) Perl Programmers Reference Guide Internals(3pm)
2
3
4
6 Internals - Reserved special namespace for internals related functions
7
9 $is_ro= Internals::SvREADONLY($x)
10 $refcnt= Internals::SvREFCNT($x)
11 hv_clear_placeholders(%hash);
12
14 The Internals namespace is used by the core Perl development team to
15 expose certain low level internals routines for testing and other
16 purposes.
17
18 In theory these routines were not and are not intended to be used
19 outside of the perl core, and are subject to change and removal at any
20 time.
21
22 In practice people have come to depend on these over the years, despite
23 being historically undocumented, so we will provide some level of
24 forward compatibility for some time. Nevertheless you can assume that
25 any routine documented here is experimental or deprecated and you
26 should find alternatives to their use.
27
28 FUNCTIONS
29 SvREFCNT(THING [, $value])
30 Historically Perl has been a refcounted language. This means that
31 each variable tracks how many things reference it, and when the
32 variable is no longer referenced it will automatically free itself.
33 In theory Perl code should not have to care about this, and in a
34 future version Perl might change to some other strategy, although
35 in practice this is unlikely.
36
37 This function allows one to violate the abstraction of variables
38 and get or set the refcount of a variable, and in generally is
39 really only useful in code that is testing refcount behavior.
40
41 *NOTE* You are strongly discouraged from using this function in
42 non-test code and especially discouraged from using the set form of
43 this function. The results of doing so may result in segmentation
44 faults or other undefined behavior.
45
46 SvREADONLY(THING, [, $value])
47 Set or get whether a variable is readonly or not. Exactly what the
48 readonly flag means depend on the type of the variable affected and
49 the version of perl used.
50
51 You are strongly discouraged from using this function directly. It
52 is used by various core modules, like "Hash::Util", and the
53 "constant" pragma to implement higher-level behavior which should
54 be used instead.
55
56 See the core implementation for the exact meaning of the readonly
57 flag for each internal variable type.
58
59 hv_clear_placeholders(%hash)
60 Clear any placeholders from a locked hash. Should not be used
61 directly. You should use the wrapper functions provided by
62 Hash::Util instead. As of 5.25 also available as "
63 Hash::Util::_clear_placeholders(%hash) "
64
66 Perl core development team.
67
69 perlguts Hash::Util constant universal.c
70
71
72
73perl v5.32.1 2021-03-31 Internals(3pm)