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.2 by root, Sun Jan 20 04:23:59 2002 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
19 20
20=over 4 21=over 4
21 22
22=cut 23=cut
23 24
24package Convert::Scalar; 25package Convert::Scalar;
25 26
26BEGIN { 27BEGIN {
27 $VERSION = 0.06; 28 $VERSION = 0.07;
28 @ISA = qw(Exporter); 29 @ISA = qw(Exporter);
29 @EXPORT_OK = qw(weaken unmagic grow); 30 @EXPORT_OK = qw(weaken unmagic grow);
30 %EXPORT_TAGS = ( 31 %EXPORT_TAGS = (
31 taint => [qw(taint untaint tainted)], 32 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)], 33 utf8 => [qw(utf8 utf8_on utf8_off utf8_valid utf8_upgrade utf8_downgrade utf8_encode utf8_decode utf8_length)],
34 refcnt => [qw(refcnt refcnt_inc refcnt_dec refcnt_rv refcnt_inc_rv refcnt_dec_rv)],
33 ); 35 );
34 36
35 require Exporter; 37 require Exporter;
36 Exporter::export_ok_tags(keys %EXPORT_TAGS); 38 Exporter::export_ok_tags(keys %EXPORT_TAGS);
37 39
120current length is less than the new value. This does not affect the 122current 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 123contents 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 124if you know the scalar will grow. The return value is the modified scalar
123(the scalar is modified in-place). 125(the scalar is modified in-place).
124 126
127=item refcnt scalar[, newrefcnt]
128
129Returns the current refference count of the given scalar and optionally sets it to
130the given reference count.
131
132=item refcnt_inc scalar
133
134Increments the reference count of the given scalar inplace.
135
136=item refcnt_dec scalar
137
138Decrements the reference count of the given scalar inplace. Use C<weaken>
139instead if you understand what this function is fore. Better yet: don't
140use this module in this case.
141
142=item refcnt_rv scalar[, newrefcnt]
143
144Works like C<refcnt>, but dereferences the given reference first. Remember
145that taking a reference of some object increases it's reference count, so
146the reference count used by the C<*_rv>-funtions tend to be one higher.
147
148=item refcnt_inc_rv scalar
149
150Works like C<refcnt_inc>, but dereferences the given reference first.
151
152=item refcnt_dec_rv scalar
153
154Works like C<refcnt_dec>, but dereferences the given reference first.
155
125=cut 156=cut
126 157
1271; 1581;
128 159
129=back 160=back

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines