ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Convert-Scalar/README
(Generate patch)

Comparing Convert-Scalar/README (file contents):
Revision 1.1 by root, Tue Mar 8 20:17:17 2005 UTC vs.
Revision 1.2 by root, Thu Aug 18 19:36:32 2011 UTC

61 utf8_length scalar 61 utf8_length scalar
62 Returns the number of characters in the string, counting wide UTF8 62 Returns the number of characters in the string, counting wide UTF8
63 characters as a single character, independent of wether the scalar 63 characters as a single character, independent of wether the scalar
64 is marked as containing bytes or mulitbyte characters. 64 is marked as containing bytes or mulitbyte characters.
65 65
66 $old = readonly scalar[, $new]
67 Returns whether the scalar is currently readonly, and sets or clears
68 the readonly status if a new status is given.
69
70 readonly_on scalar
71 Sets the readonly flag on the scalar.
72
73 readonly_off scalar
74 Clears the readonly flag on the scalar.
75
66 unmagic scalar, type 76 unmagic scalar, type
67 Remove the specified magic from the scalar (DANGEROUS!). 77 Remove the specified magic from the scalar (DANGEROUS!).
68 78
69 weaken scalar 79 weaken scalar
70 Weaken a reference. (See also WeakRef). 80 Weaken a reference. (See also WeakRef).
76 returns true when the scalar is tainted, false otherwise. 86 returns true when the scalar is tainted, false otherwise.
77 87
78 untaint scalar 88 untaint scalar
79 Remove the tainted flag from the specified scalar. 89 Remove the tainted flag from the specified scalar.
80 90
91 length = len scalar
92 Returns SvLEN (scalar), that is, the actual number of bytes
93 allocated to the string value, or "undef", is the scalar has no
94 string value.
95
81 grow scalar, newlen 96 scalar = grow scalar, newlen
82 Sets the memory area used for the scalar to the given length, if the 97 Sets the memory area used for the scalar to the given length, if the
83 current length is less than the new value. This does not affect the 98 current length is less than the new value. This does not affect the
84 contents of the scalar, but is only useful to "pre-allocate" memory 99 contents of the scalar, but is only useful to "pre-allocate" memory
85 space if you know the scalar will grow. The return value is the 100 space if you know the scalar will grow. The return value is the
86 modified scalar (the scalar is modified in-place). 101 modified scalar (the scalar is modified in-place).
102
103 scalar = extend scalar, addlen
104 Reserves enough space in the scalar so that addlen bytes can be
105 appended without reallocating it. The actual contents of the scalar
106 will not be affected. The modified scalar will also be returned.
107
108 This function is meant to make append workloads efficient - if you
109 append a short string to a scalar many times (millions of times),
110 then perl will have to reallocate and copy the scalar basically
111 every time.
112
113 If you instead use "extend $scalar, length $shortstring", then
114 Convert::Scalar will use a "size to next power of two, roughly"
115 algorithm, so as the scalar grows, perl will have to resize and copy
116 it less and less often.
87 117
88 refcnt scalar[, newrefcnt] 118 refcnt scalar[, newrefcnt]
89 Returns the current reference count of the given scalar and 119 Returns the current reference count of the given scalar and
90 optionally sets it to the given reference count. 120 optionally sets it to the given reference count.
91 121

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines