… | |
… | |
91 | removed in future versions). |
91 | removed in future versions). |
92 | |
92 | |
93 | =item utf8_length scalar |
93 | =item utf8_length scalar |
94 | |
94 | |
95 | Returns the number of characters in the string, counting wide UTF8 |
95 | Returns the number of characters in the string, counting wide UTF8 |
96 | characters as a single character, independent of wether the scalar is |
96 | characters as a single character, independent of whether the scalar is |
97 | marked as containing bytes or mulitbyte characters. |
97 | marked as containing bytes or mulitbyte characters. |
98 | |
98 | |
99 | =item $old = readonly scalar[, $new] |
99 | =item $old = readonly scalar[, $new] |
100 | |
100 | |
101 | Returns whether the scalar is currently readonly, and sets or clears the |
101 | Returns whether the scalar is currently readonly, and sets or clears the |
… | |
… | |
160 | =item nread = extend_read fh, scalar, addlen=64 |
160 | =item nread = extend_read fh, scalar, addlen=64 |
161 | |
161 | |
162 | Calls C<extend scalar, addlen> to ensure some space is available, then |
162 | Calls C<extend scalar, addlen> to ensure some space is available, then |
163 | do the equivalent of C<sysread> to the end, to try to fill the extra |
163 | do the equivalent of C<sysread> to the end, to try to fill the extra |
164 | space. Returns how many bytes have been read, C<0> on EOF or undef> on |
164 | space. Returns how many bytes have been read, C<0> on EOF or undef> on |
165 | eror, just like C<sysread>. |
165 | error, just like C<sysread>. |
166 | |
166 | |
167 | This function is useful to implement many protocols where you read some |
167 | This function is useful to implement many protocols where you read some |
168 | data, see if it is enough to decode, and if not, read some more, where the |
168 | data, see if it is enough to decode, and if not, read some more, where the |
169 | naive or easy way of doing this would result in bad performance. |
169 | naive or easy way of doing this would result in bad performance. |
170 | |
170 | |
… | |
… | |
173 | Tries to read C<length> bytes into C<scalar>. Unlike C<read> or |
173 | Tries to read C<length> bytes into C<scalar>. Unlike C<read> or |
174 | C<sysread>, it will try to read more bytes if not all bytes could be read |
174 | C<sysread>, it will try to read more bytes if not all bytes could be read |
175 | in one go (this is often called C<xread> in C). |
175 | in one go (this is often called C<xread> in C). |
176 | |
176 | |
177 | Returns the total nunmber of bytes read (normally C<length>, unless an |
177 | Returns the total nunmber of bytes read (normally C<length>, unless an |
178 | error or EOF occured), C<0> on EOF and C<undef> on errors. |
178 | error or EOF occurred), C<0> on EOF and C<undef> on errors. |
179 | |
179 | |
180 | =item nwritten = write_all fh, scalar |
180 | =item nwritten = write_all fh, scalar |
181 | |
181 | |
182 | Like C<readall>, but for writes - the equivalent of the C<xwrite> function |
182 | Like C<readall>, but for writes - the equivalent of the C<xwrite> function |
183 | often seen in C. |
183 | often seen in C. |