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

Comparing Convert-Scalar/Scalar.pm (file contents):
Revision 1.1 by root, Thu Sep 27 18:32:22 2001 UTC vs.
Revision 1.5 by root, Wed Feb 12 20:42:10 2003 UTC

12representation or state of a perl scalar. All of these work in-place, that 12representation or state of a perl scalar. All of these work in-place, that
13is, they modify their scalar argument. No functions are exported by default. 13is, they modify their scalar argument. No functions are exported by default.
14 14
15The following export tags exist: 15The following export tags exist:
16 16
17 :utf8 all functions with utf8 in their names 17 :utf8 all functions with utf8 in their name
18 :taint all functions with taint in their names 18 :taint all functions with taint in their name
19 :refcnt all functions with refcnt in their name
20 :ok all *ok-functions.
19 21
20=over 4 22=over 4
21 23
22=cut 24=cut
23 25
24package Convert::Scalar; 26package Convert::Scalar;
25 27
26BEGIN { 28BEGIN {
27 $VERSION = 0.06; 29 $VERSION = 0.1;
28 @ISA = qw(Exporter); 30 @ISA = qw(Exporter);
29 @EXPORT_OK = qw(weaken unmagic grow); 31 @EXPORT_OK = qw(weaken unmagic grow);
30 %EXPORT_TAGS = ( 32 %EXPORT_TAGS = (
31 taint => [qw(taint untaint tainted)], 33 taint => [qw(taint untaint tainted)],
32 utf8 => [qw(utf8 utf8_on utf8_off utf8_valid utf8_upgrade utf8_downgrade utf8_encode utf8_decode utf8_length)], 34 utf8 => [qw(utf8 utf8_on utf8_off utf8_valid utf8_upgrade utf8_downgrade utf8_encode utf8_decode utf8_length)],
35 refcnt => [qw(refcnt refcnt_inc refcnt_dec refcnt_rv refcnt_inc_rv refcnt_dec_rv)],
36 ok => [qw(ok uok rok pok nok niok)],
33 ); 37 );
34 38
35 require Exporter; 39 require Exporter;
36 Exporter::export_ok_tags(keys %EXPORT_TAGS); 40 Exporter::export_ok_tags(keys %EXPORT_TAGS);
37 41
120current length is less than the new value. This does not affect the 124current length is less than the new value. This does not affect the
121contents of the scalar, but is only useful to "pre-allocate" memory space 125contents of the scalar, but is only useful to "pre-allocate" memory space
122if you know the scalar will grow. The return value is the modified scalar 126if you know the scalar will grow. The return value is the modified scalar
123(the scalar is modified in-place). 127(the scalar is modified in-place).
124 128
129=item refcnt scalar[, newrefcnt]
130
131Returns the current reference count of the given scalar and optionally sets it to
132the given reference count.
133
134=item refcnt_inc scalar
135
136Increments the reference count of the given scalar inplace.
137
138=item refcnt_dec scalar
139
140Decrements the reference count of the given scalar inplace. Use C<weaken>
141instead if you understand what this function is fore. Better yet: don't
142use this module in this case.
143
144=item refcnt_rv scalar[, newrefcnt]
145
146Works like C<refcnt>, but dereferences the given reference first. Remember
147that taking a reference of some object increases it's reference count, so
148the reference count used by the C<*_rv>-funtions tend to be one higher.
149
150=item refcnt_inc_rv scalar
151
152Works like C<refcnt_inc>, but dereferences the given reference first.
153
154=item refcnt_dec_rv scalar
155
156Works like C<refcnt_dec>, but dereferences the given reference first.
157
158=item ok scalar
159
160=item uok scalar
161
162=item rok scalar
163
164=item pok scalar
165
166=item nok scalar
167
168=item niok scalar
169
170Calls SvOK, SvUOK, SvROK, SvPOK, SvNOK or SvNIOK on the given scalar,
171respectively.
172
125=cut 173=cut
126 174
1271; 1751;
128 176
129=back 177=back

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines