Commit | Line | Data |
---|---|---|
9021a1cf A |
1 | =head1 NAME |
2 | ||
3 | perldeprecation - list Perl deprecations | |
4 | ||
5 | =head1 DESCRIPTION | |
6 | ||
7 | The purpose of this document is to document what has been deprecated | |
8 | in Perl, and by which version the deprecated feature will disappear, | |
9 | or, for already removed features, when it was removed. | |
10 | ||
11 | This document will try to discuss what alternatives for the deprecated | |
12 | features are available. | |
13 | ||
14 | The deprecated features will be grouped by the version of Perl in | |
15 | which they will be removed. | |
16 | ||
68327975 JK |
17 | =head2 Perl 5.38 |
18 | ||
19 | =head3 Pod::Html utility functions | |
20 | ||
21 | The definition and documentation of three utility functions previously | |
22 | importable from L<Pod::Html> were moved to new package L<Pod::Html::Util> in | |
23 | Perl 5.36. While they remain importable from L<Pod::Html> in Perl 5.36, as of | |
24 | Perl 5.38 they will only be importable, on request, from L<Pod::Html::Util>. | |
25 | ||
a74d5574 JK |
26 | =head2 Perl 5.34 |
27 | ||
28 | There are no deprecations or fatalizations scheduled for Perl 5.34. | |
29 | ||
9840d1d6 A |
30 | =head2 Perl 5.32 |
31 | ||
32 | =head3 Constants from lexical variables potentially modified elsewhere | |
33 | ||
34 | You wrote something like | |
35 | ||
36 | my $var; | |
37 | $sub = sub () { $var }; | |
38 | ||
39 | but $var is referenced elsewhere and could be modified after the C<sub> | |
40 | expression is evaluated. Either it is explicitly modified elsewhere | |
41 | (C<$var = 3>) or it is passed to a subroutine or to an operator like | |
42 | C<printf> or C<map>, which may or may not modify the variable. | |
43 | ||
44 | Traditionally, Perl has captured the value of the variable at that | |
45 | point and turned the subroutine into a constant eligible for inlining. | |
46 | In those cases where the variable can be modified elsewhere, this | |
47 | breaks the behavior of closures, in which the subroutine captures | |
48 | the variable itself, rather than its value, so future changes to the | |
49 | variable are reflected in the subroutine's return value. | |
50 | ||
51 | If you intended for the subroutine to be eligible for inlining, then | |
52 | make sure the variable is not referenced elsewhere, possibly by | |
53 | copying it: | |
54 | ||
55 | my $var2 = $var; | |
56 | $sub = sub () { $var2 }; | |
57 | ||
58 | If you do want this subroutine to be a closure that reflects future | |
59 | changes to the variable that it closes over, add an explicit C<return>: | |
60 | ||
61 | my $var; | |
62 | $sub = sub () { return $var }; | |
63 | ||
c6b2e294 | 64 | This usage was deprecated and as of Perl 5.32 is no longer allowed. |
9840d1d6 | 65 | |
fada8285 | 66 | =head3 Use of strings with code points over 0xFF as arguments to C<vec> |
76aae383 KW |
67 | |
68 | C<vec> views its string argument as a sequence of bits. A string | |
69 | containing a code point over 0xFF is nonsensical. This usage is | |
da5a0da2 | 70 | deprecated in Perl 5.28, and was removed in Perl 5.32. |
76aae383 | 71 | |
ba52ce15 KW |
72 | =head3 Use of code points over 0xFF in string bitwise operators |
73 | ||
74 | The string bitwise operators, C<&>, C<|>, C<^>, and C<~>, treat their | |
75 | operands as strings of bytes. As such, values above 0xFF are | |
76 | nonsensical. Some instances of these have been deprecated since Perl | |
77 | 5.24, and were made fatal in 5.28, but it turns out that in cases where | |
78 | the wide characters did not affect the end result, no deprecation | |
79 | notice was raised, and so remain legal. Now, all occurrences either are | |
80 | fatal or raise a deprecation warning, so that the remaining legal | |
c8b94fe0 | 81 | occurrences became fatal in 5.32. |
ba52ce15 KW |
82 | |
83 | An example of this is | |
84 | ||
85 | "" & "\x{100}" | |
86 | ||
87 | The wide character is not used in the C<&> operation because the left | |
c8b94fe0 | 88 | operand is shorter. This now throws an exception. |
ba52ce15 | 89 | |
0c9c439d Z |
90 | =head3 hostname() doesn't accept any arguments |
91 | ||
92 | The function C<hostname()> in the L<Sys::Hostname> module has always | |
93 | been documented to be called with no arguments. Historically it has not | |
94 | enforced this, and has actually accepted and ignored any arguments. As a | |
95 | result, some users have got the mistaken impression that an argument does | |
96 | something useful. To avoid these bugs, the function is being made strict. | |
c6b2e294 | 97 | Passing arguments was deprecated in Perl 5.28 and became fatal in Perl 5.32. |
0c9c439d | 98 | |
0367231c KW |
99 | =head3 Unescaped left braces in regular expressions |
100 | ||
101 | The simple rule to remember, if you want to match a literal C<{> | |
102 | character (U+007B C<LEFT CURLY BRACKET>) in a regular expression | |
103 | pattern, is to escape each literal instance of it in some way. | |
104 | Generally easiest is to precede it with a backslash, like C<\{> | |
105 | or enclose it in square brackets (C<[{]>). If the pattern | |
106 | delimiters are also braces, any matching right brace (C<}>) should | |
107 | also be escaped to avoid confusing the parser, for example, | |
108 | ||
109 | qr{abc\{def\}ghi} | |
110 | ||
111 | Forcing literal C<{> characters to be escaped will enable the Perl | |
112 | language to be extended in various ways in future releases. To avoid | |
a3815e44 | 113 | needlessly breaking existing code, the restriction is not enforced in |
0367231c | 114 | contexts where there are unlikely to ever be extensions that could |
b2247a87 KW |
115 | conflict with the use there of C<{> as a literal. A non-deprecation |
116 | warning that the left brace is being taken literally is raised in | |
117 | contexts where there could be confusion about it. | |
0367231c KW |
118 | |
119 | Literal uses of C<{> were deprecated in Perl 5.20, and some uses of it | |
120 | started to give deprecation warnings since. These cases were made fatal | |
121 | in Perl 5.26. Due to an oversight, not all cases of a use of a literal | |
122 | C<{> got a deprecation warning. Some cases started warning in Perl 5.26, | |
c96bf7f6 | 123 | and were made fatal in Perl 5.30. Other cases started in Perl 5.28, |
ded8ea47 | 124 | and were made fatal in 5.32. |
0367231c | 125 | |
5203d63d KW |
126 | =head3 In XS code, use of various macros dealing with UTF-8. |
127 | ||
059703b0 KW |
128 | The macros below now require an extra parameter than in versions prior |
129 | to Perl 5.32. The final parameter in each one is a pointer into the | |
130 | string supplied by the first parameter beyond which the input will not | |
131 | be read. This prevents potential reading beyond the end of the buffer. | |
5203d63d KW |
132 | C<isALPHANUMERIC_utf8>, |
133 | C<isASCII_utf8>, | |
134 | C<isBLANK_utf8>, | |
135 | C<isCNTRL_utf8>, | |
136 | C<isDIGIT_utf8>, | |
137 | C<isIDFIRST_utf8>, | |
138 | C<isPSXSPC_utf8>, | |
139 | C<isSPACE_utf8>, | |
140 | C<isVERTWS_utf8>, | |
141 | C<isWORDCHAR_utf8>, | |
142 | C<isXDIGIT_utf8>, | |
143 | C<isALPHANUMERIC_LC_utf8>, | |
144 | C<isALPHA_LC_utf8>, | |
145 | C<isASCII_LC_utf8>, | |
146 | C<isBLANK_LC_utf8>, | |
147 | C<isCNTRL_LC_utf8>, | |
148 | C<isDIGIT_LC_utf8>, | |
149 | C<isGRAPH_LC_utf8>, | |
150 | C<isIDCONT_LC_utf8>, | |
151 | C<isIDFIRST_LC_utf8>, | |
152 | C<isLOWER_LC_utf8>, | |
153 | C<isPRINT_LC_utf8>, | |
154 | C<isPSXSPC_LC_utf8>, | |
155 | C<isPUNCT_LC_utf8>, | |
156 | C<isSPACE_LC_utf8>, | |
157 | C<isUPPER_LC_utf8>, | |
158 | C<isWORDCHAR_LC_utf8>, | |
159 | C<isXDIGIT_LC_utf8>, | |
160 | C<toFOLD_utf8>, | |
161 | C<toLOWER_utf8>, | |
162 | C<toTITLE_utf8>, | |
163 | and | |
164 | C<toUPPER_utf8>. | |
165 | ||
059703b0 KW |
166 | Since Perl 5.26, this functionality with the extra parameter has been |
167 | available by using a corresponding macro to each one of these, and whose | |
168 | name is formed by appending C<_safe> to the base name. There is no | |
169 | change to the functionality of those. For example, C<isDIGIT_utf8_safe> | |
170 | corresponds to C<isDIGIT_utf8>, and both now behave identically. All | |
171 | are documented in L<perlapi/Character case changing> and | |
5203d63d KW |
172 | L<perlapi/Character classification>. |
173 | ||
ded8ea47 KW |
174 | This change was originally scheduled for 5.30, but was delayed until |
175 | 5.32. | |
5203d63d | 176 | |
4db50d5b S |
177 | =head3 C<< File::Glob::glob() >> was removed |
178 | ||
179 | C<< File::Glob >> has a function called C<< glob >>, which just calls | |
180 | C<< bsd_glob >>. | |
181 | ||
182 | C<< File::Glob::glob() >> was deprecated in Perl 5.8. A deprecation | |
183 | message was issued from Perl 5.26 onwards, and the function has now | |
184 | disappeared in Perl 5.30. | |
185 | ||
186 | Code using C<< File::Glob::glob() >> should call | |
187 | C<< File::Glob::bsd_glob() >> instead. | |
188 | ||
a0e213fc A |
189 | =head2 Perl 5.30 |
190 | ||
37398dc1 A |
191 | =head3 C<< $* >> is no longer supported |
192 | ||
193 | Before Perl 5.10, setting C<< $* >> to a true value globally enabled | |
194 | multi-line matching within a string. This relique from the past lost | |
195 | its special meaning in 5.10. Use of this variable will be a fatal error | |
196 | in Perl 5.30, freeing the variable up for a future special meaning. | |
197 | ||
198 | To enable multiline matching one should use the C<< /m >> regexp | |
199 | modifier (possibly in combination with C<< /s >>). This can be set | |
200 | on a per match bases, or can be enabled per lexical scope (including | |
201 | a whole file) with C<< use re '/m' >>. | |
202 | ||
203 | =head3 C<< $# >> is no longer supported | |
204 | ||
205 | This variable used to have a special meaning -- it could be used | |
206 | to control how numbers were formatted when printed. This seldom | |
207 | used functionality was removed in Perl 5.10. In order to free up | |
208 | the variable for a future special meaning, its use will be a fatal | |
209 | error in Perl 5.30. | |
210 | ||
33f0d962 | 211 | To specify how numbers are formatted when printed, one is advised |
37398dc1 A |
212 | to use C<< printf >> or C<< sprintf >> instead. |
213 | ||
c22e17d0 | 214 | =head3 Assigning non-zero to C<< $[ >> is fatal |
8e796115 DIM |
215 | |
216 | This variable (and the corresponding C<array_base> feature and | |
c22e17d0 | 217 | L<arybase> module) allowed changing the base for array and string |
8e796115 DIM |
218 | indexing operations. |
219 | ||
220 | Setting this to a non-zero value has been deprecated since Perl 5.12 and | |
c22e17d0 | 221 | throws a fatal error as of Perl 5.30. |
8e796115 | 222 | |
a0e213fc A |
223 | =head3 C<< File::Glob::glob() >> will disappear |
224 | ||
225 | C<< File::Glob >> has a function called C<< glob >>, which just calls | |
226 | C<< bsd_glob >>. However, its prototype is different from the prototype | |
227 | of C<< CORE::glob >>, and hence, C<< File::Glob::glob >> should not | |
228 | be used. | |
229 | ||
d1be68f6 A |
230 | C<< File::Glob::glob() >> was deprecated in Perl 5.8. A deprecation |
231 | message was issued from Perl 5.26 onwards, and the function will | |
232 | disappear in Perl 5.30. | |
a0e213fc A |
233 | |
234 | Code using C<< File::Glob::glob() >> should call | |
235 | C<< File::Glob::bsd_glob() >> instead. | |
236 | ||
0367231c | 237 | =head3 Unescaped left braces in regular expressions (for 5.30) |
286c9456 | 238 | |
0367231c | 239 | See L</Unescaped left braces in regular expressions> above. |
286c9456 | 240 | |
30b17cc1 A |
241 | =head3 Unqualified C<dump()> |
242 | ||
243 | Use of C<dump()> instead of C<CORE::dump()> was deprecated in Perl 5.8, | |
244 | and an unqualified C<dump()> will no longer be available in Perl 5.30. | |
245 | ||
246 | See L<perlfunc/dump>. | |
247 | ||
286c9456 | 248 | |
afb5c82e | 249 | =head3 Using my() in false conditional. |
c437f7ac A |
250 | |
251 | There has been a long-standing bug in Perl that causes a lexical variable | |
252 | not to be cleared at scope exit when its declaration includes a false | |
253 | conditional. Some people have exploited this bug to achieve a kind of | |
bbadd5d3 | 254 | static variable. To allow us to fix this bug, people should not be |
c437f7ac A |
255 | relying on this behavior. |
256 | ||
257 | Instead, it's recommended one uses C<state> variables to achieve the | |
258 | same effect: | |
259 | ||
260 | use 5.10.0; | |
261 | sub count {state $counter; return ++ $counter} | |
262 | say count (); # Prints 1 | |
263 | say count (); # Prints 2 | |
264 | ||
265 | C<state> variables were introduced in Perl 5.10. | |
266 | ||
267 | Alternatively, you can achieve a similar static effect by | |
bbadd5d3 | 268 | declaring the variable in a separate block outside the function, e.g., |
c437f7ac A |
269 | |
270 | sub f { my $x if 0; return $x++ } | |
271 | ||
272 | becomes | |
273 | ||
274 | { my $x; sub f { return $x++ } } | |
275 | ||
276 | The use of C<my()> in a false conditional has been deprecated in | |
bbadd5d3 | 277 | Perl 5.10, and became a fatal error in Perl 5.30. |
c437f7ac | 278 | |
1972ac5c A |
279 | |
280 | =head3 Reading/writing bytes from/to :utf8 handles. | |
281 | ||
282 | The sysread(), recv(), syswrite() and send() operators are | |
283 | deprecated on handles that have the C<:utf8> layer, either explicitly, or | |
284 | implicitly, eg., with the C<:encoding(UTF-16LE)> layer. | |
285 | ||
286 | Both sysread() and recv() currently use only the C<:utf8> flag for the stream, | |
287 | ignoring the actual layers. Since sysread() and recv() do no UTF-8 | |
288 | validation they can end up creating invalidly encoded scalars. | |
289 | ||
290 | Similarly, syswrite() and send() use only the C<:utf8> flag, otherwise ignoring | |
291 | any layers. If the flag is set, both write the value UTF-8 encoded, even if | |
292 | the layer is some different encoding, such as the example above. | |
293 | ||
294 | Ideally, all of these operators would completely ignore the C<:utf8> state, | |
295 | working only with bytes, but this would result in silently breaking existing | |
296 | code. To avoid this a future version of perl will throw an exception when | |
297 | any of sysread(), recv(), syswrite() or send() are called on handle with the | |
298 | C<:utf8> layer. | |
299 | ||
300 | In Perl 5.30, it will no longer be possible to use sysread(), recv(), | |
301 | syswrite() or send() to read or send bytes from/to :utf8 handles. | |
302 | ||
30573109 A |
303 | |
304 | =head3 Use of unassigned code point or non-standalone grapheme for a delimiter. | |
305 | ||
306 | A grapheme is what appears to a native-speaker of a language to be a | |
307 | character. In Unicode (and hence Perl) a grapheme may actually be | |
308 | several adjacent characters that together form a complete grapheme. For | |
309 | example, there can be a base character, like "R" and an accent, like a | |
4c821bda KW |
310 | circumflex "^", that appear to be a single character when displayed, |
311 | with the circumflex hovering over the "R". | |
312 | ||
313 | As of Perl 5.30, use of delimiters which are non-standalone graphemes is | |
314 | fatal, in order to move the language to be able to accept | |
315 | multi-character graphemes as delimiters. | |
316 | ||
c96bf7f6 | 317 | Also, as of Perl 5.30, delimiters which are unassigned code points |
4c821bda KW |
318 | but that may someday become assigned are prohibited. Otherwise, code |
319 | that works today would fail to compile if the currently unassigned | |
320 | delimiter ends up being something that isn't a stand-alone grapheme. | |
321 | Because Unicode is never going to assign L<non-character code | |
322 | points|perlunicode/Noncharacter code points>, nor L<code points that are | |
c96bf7f6 | 323 | above the legal Unicode maximum|perlunicode/Beyond Unicode code |
4c821bda | 324 | points>, those can be delimiters. |
30573109 | 325 | |
c9680906 A |
326 | =head2 Perl 5.28 |
327 | ||
dcc013e3 | 328 | =head3 Attributes C<< :locked >> and C<< :unique >> |
c9680906 A |
329 | |
330 | The attributes C<< :locked >> (on code references) and C<< :unique >> | |
331 | (on array, hash and scalar references) have had no effect since | |
332 | Perl 5.005 and Perl 5.8.8 respectively. Their use has been deprecated | |
333 | since. | |
334 | ||
d1f1f359 | 335 | As of Perl 5.28, these attributes are syntax errors. Since the |
dcc013e3 A |
336 | attributes do not do anything, removing them from your code fixes |
337 | the syntax error; and removing them will not influence the behaviour | |
338 | of your code. | |
c9680906 | 339 | |
ac641426 | 340 | |
e5aa3f0b A |
341 | =head3 Bare here-document terminators |
342 | ||
343 | Perl has allowed you to use a bare here-document terminator to have the | |
344 | here-document end at the first empty line. This practise was deprecated | |
d1f1f359 | 345 | in Perl 5.000; as of Perl 5.28, using a bare here-document terminator |
dcc013e3 | 346 | throws a fatal error. |
e5aa3f0b | 347 | |
33f0d962 | 348 | You are encouraged to use the explicitly quoted form if you wish to |
e5aa3f0b A |
349 | use an empty line as the terminator of the here-document: |
350 | ||
351 | print <<""; | |
352 | Print this line. | |
353 | ||
354 | # Previous blank line ends the here-document. | |
355 | ||
356 | ||
d8940893 A |
357 | =head3 Setting $/ to a reference to a non-positive integer |
358 | ||
359 | You assigned a reference to a scalar to C<$/> where the | |
360 | referenced item is not a positive integer. In older perls this B<appeared> | |
361 | to work the same as setting it to C<undef> but was in fact internally | |
362 | different, less efficient and with very bad luck could have resulted in | |
363 | your file being split by a stringified form of the reference. | |
364 | ||
365 | In Perl 5.20.0 this was changed so that it would be B<exactly> the same as | |
366 | setting C<$/> to undef, with the exception that this warning would be | |
367 | thrown. | |
368 | ||
dcc013e3 A |
369 | As of Perl 5.28, setting C<$/> to a reference of a non-positive |
370 | integer throws a fatal error. | |
d8940893 A |
371 | |
372 | You are recommended to change your code to set C<$/> to C<undef> explicitly | |
373 | if you wish to slurp the file. | |
374 | ||
375 | ||
fcdb3ac1 A |
376 | =head3 Limit on the value of Unicode code points. |
377 | ||
dcc013e3 A |
378 | Unicode only allows code points up to 0x10FFFF, but Perl allows |
379 | much larger ones. Up till Perl 5.28, it was allowed to use code | |
380 | points exceeding the maximum value of an integer (C<IV_MAX>). | |
381 | However, that did break the perl interpreter in some constructs, | |
382 | including causing it to hang in a few cases. The known problem | |
383 | areas were in C<tr///>, regular expression pattern matching using | |
384 | quantifiers, as quote delimiters in C<qI<X>...I<X>> (where I<X> is | |
385 | the C<chr()> of a large code point), and as the upper limits in | |
386 | loops. | |
fcdb3ac1 | 387 | |
d1f1f359 | 388 | The use of out of range code points was deprecated in Perl 5.24; as of |
dcc013e3 | 389 | Perl 5.28 using a code point exceeding C<IV_MAX> throws a fatal error. |
fcdb3ac1 A |
390 | |
391 | If your code is to run on various platforms, keep in mind that the upper | |
dcc013e3 A |
392 | limit depends on the platform. It is much larger on 64-bit word sizes |
393 | than 32-bit ones. For 32-bit integers, C<IV_MAX> equals C<0x7FFFFFFF>, | |
394 | for 64-bit integers, C<IV_MAX> equals C<0x7FFFFFFFFFFFFFFF>. | |
fcdb3ac1 | 395 | |
db99d38d | 396 | |
6ef4f8b7 A |
397 | =head3 Use of comma-less variable list in formats. |
398 | ||
dcc013e3 | 399 | It was allowed to use a list of variables in a format, without |
6ef4f8b7 | 400 | separating them with commas. This usage has been deprecated |
d1f1f359 | 401 | for a long time, and as of Perl 5.28, this throws a fatal error. |
6ef4f8b7 | 402 | |
db99d38d A |
403 | =head3 Use of C<\N{}> |
404 | ||
405 | Use of C<\N{}> with nothing between the braces was deprecated in | |
be332ba0 | 406 | Perl 5.24, and throws a fatal error as of Perl 5.28. |
db99d38d A |
407 | |
408 | Since such a construct is equivalent to using an empty string, | |
409 | you are recommended to remove such C<\N{}> constructs. | |
410 | ||
122d6c09 A |
411 | =head3 Using the same symbol to open a filehandle and a dirhandle |
412 | ||
413 | It used to be legal to use C<open()> to associate both a | |
414 | filehandle and a dirhandle to the same symbol (glob or scalar). | |
415 | This idiom is likely to be confusing, and it was deprecated in | |
416 | Perl 5.10. | |
417 | ||
418 | Using the same symbol to C<open()> a filehandle and a dirhandle | |
d1f1f359 | 419 | throws a fatal error as of Perl 5.28. |
122d6c09 A |
420 | |
421 | You should be using two different symbols instead. | |
422 | ||
ac641426 A |
423 | =head3 ${^ENCODING} is no longer supported. |
424 | ||
425 | The special variable C<${^ENCODING}> was used to implement | |
426 | the C<encoding> pragma. Setting this variable to anything other | |
427 | than C<undef> was deprecated in Perl 5.22. Full deprecation | |
428 | of the variable happened in Perl 5.25.3. | |
429 | ||
dcc013e3 | 430 | Setting this variable to anything other than an undefined value |
d1f1f359 | 431 | throws a fatal error as of Perl 5.28. |
ac641426 | 432 | |
d9d53e86 | 433 | |
838ba4df A |
434 | =head3 C<< B::OP::terse >> |
435 | ||
436 | This method, which just calls C<< B::Concise::b_terse >>, has been | |
dcc013e3 | 437 | deprecated, and disappeared in Perl 5.28. Please use |
838ba4df A |
438 | C<< B::Concise >> instead. |
439 | ||
440 | ||
d9d53e86 | 441 | |
dcc013e3 | 442 | =head3 Use of inherited AUTOLOAD for non-method %s::%s() is no longer allowed |
d9d53e86 | 443 | |
dcc013e3 | 444 | As an (ahem) accidental feature, C<AUTOLOAD> subroutines were looked |
d9d53e86 A |
445 | up as methods (using the C<@ISA> hierarchy) even when the subroutines |
446 | to be autoloaded were called as plain functions (e.g. C<Foo::bar()>), | |
447 | not as methods (e.g. C<< Foo->bar() >> or C<< $obj->bar() >>). | |
448 | ||
dcc013e3 A |
449 | This bug was deprecated in Perl 5.004, has been rectified in Perl 5.28 |
450 | by using method lookup only for methods' C<AUTOLOAD>s. | |
d9d53e86 A |
451 | |
452 | The simple rule is: Inheritance will not work when autoloading | |
453 | non-methods. The simple fix for old code is: In any module that used | |
454 | to depend on inheriting C<AUTOLOAD> for non-methods from a base class | |
455 | named C<BaseClass>, execute C<*AUTOLOAD = \&BaseClass::AUTOLOAD> during | |
456 | startup. | |
457 | ||
458 | In code that currently says C<use AutoLoader; @ISA = qw(AutoLoader);> | |
459 | you should remove AutoLoader from @ISA and change C<use AutoLoader;> to | |
460 | C<use AutoLoader 'AUTOLOAD';>. | |
461 | ||
d9d53e86 | 462 | |
ecbcbef0 A |
463 | =head3 Use of code points over 0xFF in string bitwise operators |
464 | ||
465 | The string bitwise operators, C<&>, C<|>, C<^>, and C<~>, treat | |
466 | their operands as strings of bytes. As such, values above 0xFF | |
467 | are nonsensical. Using such code points with these operators | |
d1f1f359 | 468 | was deprecated in Perl 5.24, and is fatal as of Perl 5.28. |
ecbcbef0 | 469 | |
36d3e805 KW |
470 | =head3 In XS code, use of C<to_utf8_case()> |
471 | ||
f566c7cf | 472 | This function has been removed as of Perl 5.28; instead convert to call |
36d3e805 KW |
473 | the appropriate one of: |
474 | L<C<toFOLD_utf8_safe>|perlapi/toFOLD_utf8_safe>. | |
475 | L<C<toLOWER_utf8_safe>|perlapi/toLOWER_utf8_safe>, | |
476 | L<C<toTITLE_utf8_safe>|perlapi/toTITLE_utf8_safe>, | |
477 | or | |
478 | L<C<toUPPER_utf8_safe>|perlapi/toUPPER_utf8_safe>. | |
bfdc8cd3 | 479 | |
856f8944 A |
480 | =head2 Perl 5.26 |
481 | ||
482 | =head3 C<< --libpods >> in C<< Pod::Html >> | |
483 | ||
484 | Since Perl 5.18, the option C<< --libpods >> has been deprecated, and | |
485 | using this option did not do anything other than producing a warning. | |
486 | ||
d1f1f359 | 487 | The C<< --libpods >> option is no longer recognized as of Perl 5.26. |
856f8944 A |
488 | |
489 | ||
2560602c A |
490 | =head3 The utilities C<< c2ph >> and C<< pstruct >> |
491 | ||
492 | These old, perl3-era utilities have been deprecated in favour of | |
d1f1f359 | 493 | C<< h2xs >> for a long time. As of Perl 5.26, they have been removed. |
2560602c | 494 | |
d9d53e86 | 495 | |
4a29ab5e A |
496 | =head3 Trapping C<< $SIG {__DIE__} >> other than during program exit. |
497 | ||
498 | The C<$SIG{__DIE__}> hook is called even inside an C<eval()>. It was | |
499 | never intended to happen this way, but an implementation glitch made | |
500 | this possible. This used to be deprecated, as it allowed strange action | |
501 | at a distance like rewriting a pending exception in C<$@>. Plans to | |
502 | rectify this have been scrapped, as users found that rewriting a | |
503 | pending exception is actually a useful feature, and not a bug. | |
504 | ||
505 | Perl never issued a deprecation warning for this; the deprecation | |
506 | was by documentation policy only. But this deprecation has been | |
d1f1f359 | 507 | lifted as of Perl 5.26. |
4a29ab5e A |
508 | |
509 | ||
24ca4586 A |
510 | =head3 Malformed UTF-8 string in "%s" |
511 | ||
512 | This message indicates a bug either in the Perl core or in XS | |
513 | code. Such code was trying to find out if a character, allegedly | |
514 | stored internally encoded as UTF-8, was of a given type, such as | |
515 | being punctuation or a digit. But the character was not encoded | |
516 | in legal UTF-8. The C<%s> is replaced by a string that can be used | |
517 | by knowledgeable people to determine what the type being checked | |
518 | against was. | |
519 | ||
520 | Passing malformed strings was deprecated in Perl 5.18, and | |
521 | became fatal in Perl 5.26. | |
522 | ||
523 | ||
9021a1cf A |
524 | =head2 Perl 5.24 |
525 | ||
526 | =head3 Use of C<< *glob{FILEHANDLE} >> | |
527 | ||
d1be68f6 | 528 | The use of C<< *glob{FILEHANDLE} >> was deprecated in Perl 5.8. |
9021a1cf A |
529 | The intention was to use C<< *glob{IO} >> instead, for which |
530 | C<< *glob{FILEHANDLE} >> is an alias. | |
531 | ||
d1be68f6 | 532 | However, this feature was undeprecated in Perl 5.24. |
9021a1cf | 533 | |
46d7f3c1 A |
534 | =head3 Calling POSIX::%s() is deprecated |
535 | ||
536 | The following functions in the C<POSIX> module are no longer available: | |
537 | C<isalnum>, C<isalpha>, C<iscntrl>, C<isdigit>, C<isgraph>, C<islower>, | |
538 | C<isprint>, C<ispunct>, C<isspace>, C<isupper>, and C<isxdigit>. The | |
539 | functions are buggy and don't work on UTF-8 encoded strings. See their | |
540 | entries in L<POSIX> for more information. | |
541 | ||
d1be68f6 | 542 | The functions were deprecated in Perl 5.20, and removed in Perl 5.24. |
46d7f3c1 A |
543 | |
544 | ||
c4d8d6a2 A |
545 | =head2 Perl 5.16 |
546 | ||
547 | =head3 Use of %s on a handle without * is deprecated | |
548 | ||
549 | It used to be possible to use C<tie>, C<tied> or C<untie> on a scalar | |
550 | while the scalar holds a typeglob. This caused its filehandle to be | |
551 | tied. It left no way to tie the scalar itself when it held a typeglob, | |
552 | and no way to untie a scalar that had had a typeglob assigned to it. | |
553 | ||
d1be68f6 | 554 | This was deprecated in Perl 5.14, and the bug was fixed in Perl 5.16. |
c4d8d6a2 A |
555 | |
556 | So now C<tie $scalar> will always tie the scalar, not the handle it holds. | |
557 | To tie the handle, use C<tie *$scalar> (with an explicit asterisk). The same | |
558 | applies to C<tied *$scalar> and C<untie *$scalar>. | |
559 | ||
560 | ||
9021a1cf A |
561 | =head1 SEE ALSO |
562 | ||
563 | L<warnings>, L<diagnostics>. | |
564 | ||
565 | =cut |