… | |
… | |
15 | The following export tags exist: |
15 | The following export tags exist: |
16 | |
16 | |
17 | :utf8 all functions with utf8 in their name |
17 | :utf8 all functions with utf8 in their name |
18 | :taint all functions with taint in their name |
18 | :taint all functions with taint in their name |
19 | :refcnt all functions with refcnt in their name |
19 | :refcnt all functions with refcnt in their name |
|
|
20 | :ok all *ok-functions. |
20 | |
21 | |
21 | =over 4 |
22 | =over 4 |
22 | |
23 | |
23 | =cut |
24 | =cut |
24 | |
25 | |
25 | package Convert::Scalar; |
26 | package Convert::Scalar; |
26 | |
27 | |
27 | BEGIN { |
28 | BEGIN { |
28 | $VERSION = 0.08; |
29 | $VERSION = '1.04'; |
29 | @ISA = qw(Exporter); |
30 | @ISA = qw(Exporter); |
30 | @EXPORT_OK = qw(weaken unmagic grow); |
31 | @EXPORT_OK = qw(weaken unmagic grow); |
31 | %EXPORT_TAGS = ( |
32 | %EXPORT_TAGS = ( |
32 | taint => [qw(taint untaint tainted)], |
33 | taint => [qw(taint untaint tainted)], |
33 | 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)], |
34 | refcnt => [qw(refcnt refcnt_inc refcnt_dec refcnt_rv refcnt_inc_rv refcnt_dec_rv)], |
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)], |
35 | ); |
37 | ); |
36 | |
38 | |
37 | require Exporter; |
39 | require Exporter; |
38 | Exporter::export_ok_tags(keys %EXPORT_TAGS); |
40 | Exporter::export_ok_tags(keys %EXPORT_TAGS); |
39 | |
41 | |
… | |
… | |
92 | |
94 | |
93 | Returns the number of characters in the string, counting wide UTF8 |
95 | Returns the number of characters in the string, counting wide UTF8 |
94 | characters as a single character, independent of wether the scalar is |
96 | characters as a single character, independent of wether the scalar is |
95 | marked as containing bytes or mulitbyte characters. |
97 | marked as containing bytes or mulitbyte characters. |
96 | |
98 | |
97 | =item unmagic scalar |
99 | =item unmagic scalar, type |
98 | |
100 | |
99 | Removes magic from the scalar. |
101 | Remove the specified magic from the scalar (DANGEROUS!). |
100 | |
102 | |
101 | =item weaken scalar |
103 | =item weaken scalar |
102 | |
104 | |
103 | Weaken a reference. (See also L<WeakRef>). |
105 | Weaken a reference. (See also L<WeakRef>). |
104 | |
106 | |
… | |
… | |
108 | |
110 | |
109 | =item tainted scalar |
111 | =item tainted scalar |
110 | |
112 | |
111 | returns true when the scalar is tainted, false otherwise. |
113 | returns true when the scalar is tainted, false otherwise. |
112 | |
114 | |
113 | =item untaint scalar, type |
115 | =item untaint scalar |
114 | |
116 | |
115 | Remove the specified magic from the scalar |
117 | Remove the tainted flag from the specified scalar. |
116 | (DANGEROUS!), L<perlguts>. L<Untaint>, for a similar but different |
|
|
117 | interface. |
|
|
118 | |
118 | |
119 | =item grow scalar, newlen |
119 | =item grow scalar, newlen |
120 | |
120 | |
121 | Sets the memory area used for the scalar to the given length, if the |
121 | Sets the memory area used for the scalar to the given length, if the |
122 | current length is less than the new value. This does not affect the |
122 | current length is less than the new value. This does not affect the |
… | |
… | |
139 | instead if you understand what this function is fore. Better yet: don't |
139 | instead if you understand what this function is fore. Better yet: don't |
140 | use this module in this case. |
140 | use this module in this case. |
141 | |
141 | |
142 | =item refcnt_rv scalar[, newrefcnt] |
142 | =item refcnt_rv scalar[, newrefcnt] |
143 | |
143 | |
144 | Works like C<refcnt>, but dereferences the given reference first. Remember |
144 | Works like C<refcnt>, but dereferences the given reference first. This is |
145 | that taking a reference of some object increases it's reference count, so |
145 | useful to find the reference count of arrays or hashes, which cnanot be |
146 | the reference count used by the C<*_rv>-funtions tend to be one higher. |
146 | passed directly. Remember that taking a reference of some object increases |
|
|
147 | it's reference count, so the reference count used by the C<*_rv>-functions |
|
|
148 | tend to be one higher. |
147 | |
149 | |
148 | =item refcnt_inc_rv scalar |
150 | =item refcnt_inc_rv scalar |
149 | |
151 | |
150 | Works like C<refcnt_inc>, but dereferences the given reference first. |
152 | Works like C<refcnt_inc>, but dereferences the given reference first. |
151 | |
153 | |
152 | =item refcnt_dec_rv scalar |
154 | =item refcnt_dec_rv scalar |
153 | |
155 | |
154 | Works like C<refcnt_dec>, but dereferences the given reference first. |
156 | Works 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 | |
|
|
170 | Calls SvOK, SvUOK, SvROK, SvPOK, SvNOK or SvNIOK on the given scalar, |
|
|
171 | respectively. |
155 | |
172 | |
156 | =cut |
173 | =cut |
157 | |
174 | |
158 | 1; |
175 | 1; |
159 | |
176 | |
… | |
… | |
169 | sv_pvutf8n_force |
186 | sv_pvutf8n_force |
170 | the sv2xx family |
187 | the sv2xx family |
171 | |
188 | |
172 | =head1 AUTHOR |
189 | =head1 AUTHOR |
173 | |
190 | |
174 | Marc Lehmann <pcg@goof.com> |
191 | Marc Lehmann <schmorp@schmorp.de> |
175 | http://www.goof.com/pcg/marc/ |
192 | http://home.schmorp.de/ |
176 | |
193 | |
177 | =cut |
194 | =cut |
178 | |
195 | |