Debian Codegraph @

upstream/debian-unstable/man1/perldeprecation.1

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "PERLDEPRECATION 1"
58 .TH PERLDEPRECATION 1 2025-11-16 "perl v5.40.1" "Perl Programmers Reference Guide"
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 perldeprecation \- list Perl deprecations
65 .SH DESCRIPTION
66 .IX Header "DESCRIPTION"
67 The purpose of this document is to document what has been deprecated
68 in Perl, and by which version the deprecated feature will disappear,
69 or, for already removed features, when it was removed.
70 .PP
71 This document will try to discuss what alternatives for the deprecated
72 features are available.
73 .PP
74 The deprecated features will be grouped by the version of Perl in
75 which they will be removed.
76 .SS "Unscheduled Deprecations"
77 .IX Subsection "Unscheduled Deprecations"
78 \fIUnicode Delimiter Will be Paired\fR
79 .IX Subsection "Unicode Delimiter Will be Paired"
80 .PP
81 Some unicode delimiters used to be allowed as single characters, but
82 in the future will be part of a balanced pair. This deprecation category
83 is used to mark the ones that will change from being unpaired to paired.
84 .PP
85 Category: "deprecated::delimiter_will_be_paired"
86 .PP
87 \fIDot In Inc\fR
88 .IX Subsection "Dot In Inc"
89 .PP
90 The current working directory \f(CW\*(C`.\*(C'\fR used to be automatically included in
91 \&\f(CW@INC\fR, but in Perl 5.26 this was removed for security reasons. Ever
92 since then we have produced a warning when a user uses \f(CW\*(C`do EXPR\*(C'\fR and
93 \&\f(CW\*(C`EXPR\*(C'\fR does not include a path, and the file was not found in any
94 directory in \f(CW@INC\fR but \fIwas\fR located in \f(CW\*(C`.\*(C'\fR. The file will not be loaded
95 but a deprecated warning will be generated.
96 .PP
97 Category: "deprecated::dot_in_inc"
98 .PP
99 \fIUnicode Property Name\fR
100 .IX Subsection "Unicode Property Name"
101 .PP
102 Various types of unicode property name will generate deprecated warnings
103 when used in a regex pattern. For instance surrogate characters will result
104 in deprecation warnings.
105 .PP
106 Category: "deprecated::unicode_property_name"
107 .SS "Perl 5.44"
108 .IX Subsection "Perl 5.44"
109 \fICalling a missing \fR\f(CIimport()\fR\fI or \fR\f(CIunimport()\fR\fI method with an argument\fR
110 .IX Subsection "Calling a missing import() or unimport() method with an argument"
111 .PP
112 Historically calling \f(CWimport()\fR or \f(CWunimport()\fR on any class which did
113 not define such a method would be silently ignored. Effectively Perl
114 behaved as though there was an empty method defined in the \f(CW\*(C`UNIVERSAL\*(C'\fR
115 package (even when there was no such method actually defined). As of
116 Perl version 5.39.2 calling such a method \fIwith\fR an argument will
117 trigger a warning, and in Perl version 5.44 this warning will be
118 upgraded to an error. (Calling such a method with no arguments at all
119 will always be safe.)
120 .PP
121 Category: "deprecated::missing_import_called_with_args"
122 .PP
123 \fIChanging \fR\f(CI\*(C`use VERSION\*(C'\fR\fI while another \fR\f(CI\*(C`use VERSION\*(C'\fR\fI is in scope\fR
124 .IX Subsection "Changing use VERSION while another use VERSION is in scope"
125 .PP
126 A \f(CW\*(C`use VERSION\*(C'\fR declaration has many implicit effects on the surrounding
127 scope, such as strict and feature flags, or importing builtin
128 functions. Once you have a \f(CW\*(C`use VERSION\*(C'\fR statement in scope, another
129 \&\f(CW\*(C`use VERSION\*(C'\fR statement with a different version is now deprecated since
130 Perl 5.39.8, due to the increasing complexity of swapping from one
131 prevailing version to another.
132 .PP
133 Category: "deprecated::subsequent_use_version"
134 .SS "Perl 5.42"
135 .IX Subsection "Perl 5.42"
136 \fISmartmatch\fR
137 .IX Subsection "Smartmatch"
138 .PP
139 Smartmatch is now seen as a failed experiment and was marked as deprecated
140 in Perl 5.37.10. This includes the \f(CW\*(C`when\*(C'\fR and \f(CW\*(C`given\*(C'\fR keywords, as well
141 as the smartmatch operator \f(CW\*(C`~~\*(C'\fR. The feature will be removed entirely in the
142 Perl 5.42.0 production release.
143 .PP
144 Category: "deprecated::smartmatch"
145 .PP
146 \fIGoto Block Construct\fR
147 .IX Subsection "Goto Block Construct"
148 .PP
149 \&\f(CW\*(C`goto LABEL;\*(C'\fR will produce a deprecated warning when jumping into the body
150 of a loop or other block construct from outside. For instance
151 .PP
152 .Vb 5
153 \& while (should_loop($x)) {
154 \& LABEL:
155 \& do_stuff();
156 \& }
157 \& goto LABEL;
158 .Ve
159 .PP
160 will produce a warning that this behavior is deprecated. In general you should
161 just avoid doing this; the people that maintain your code will be grateful for
162 your restraint.
163 .PP
164 Category: "deprecated::goto_construct"
165 .PP
166 \fIUse of \fR\f(CI\*(C`\*(Aq\*(C'\fR\fI as a global name separator\fR
167 .IX Subsection "Use of as a global name separator"
168 .PP
169 Perl allows use of \f(CW\*(C`\*(Aq\*(C'\fR instead of \f(CW\*(C`::\*(C'\fR to replace the parts of a
170 package or global variable name, for example \f(CW\*(C`A::B\*(C'\fR and \f(CW\*(C`A\*(AqB\*(C'\fR are
171 equivalent.
172 .PP
173 \&\f(CW\*(C`\*(Aq\*(C'\fR will no longer be recognized as a name separator in Perl 5.42.
174 .PP
175 Category: "deprecated::apostrophe_as_package_separator"
176 .SS "Perl 5.40"
177 .IX Subsection "Perl 5.40"
178 \fIDowngrading a \fR\f(CI\*(C`use VERSION\*(C'\fR\fI to below v5.11\fR
179 .IX Subsection "Downgrading a use VERSION to below v5.11"
180 .PP
181 Once Perl has seen a \f(CW\*(C`use VERSION\*(C'\fR declaration that requests a version
182 \&\f(CW\*(C`v5.11\*(C'\fR or above, a subsequent second declaration that requests an earlier
183 version will print a deprecation warning. For example,
184 .PP
185 .Vb 2
186 \& use v5.14;
187 \& say "We can use v5.14\*(Aqs features here";
188 \&
189 \& use v5.10; # This prints a warning
190 .Ve
191 .PP
192 This was deprecated in Perl 5.36 and is now fatal.
193 .PP
194 This is because of an intended related change to the interaction between
195 \&\f(CW\*(C`use VERSION\*(C'\fR and \f(CW\*(C`use strict\*(C'\fR. If you specify a version >= 5.11, strict is
196 enabled implicitly. If you request a version < 5.11, strict will become
197 disabled \fIeven if you had previously written\fR \f(CW\*(C`use strict\*(C'\fR. This was not
198 the previous behaviour of \f(CW\*(C`use VERSION\*(C'\fR, which at present will track
199 explicitly-enabled strictness flags independently.
200 .PP
201 Category: "deprecated::version_downgrade"
202 .SS "Perl 5.38"
203 .IX Subsection "Perl 5.38"
204 \fIPod::Html utility functions\fR
205 .IX Subsection "Pod::Html utility functions"
206 .PP
207 The definition and documentation of three utility functions previously
208 importable from Pod::Html were moved to new package Pod::Html::Util in
209 Perl 5.36. While they remained importable from Pod::Html in Perl 5.36, as
210 of Perl 5.38 they are only importable, on request, from Pod::Html::Util.
211 .SS "Perl 5.34"
212 .IX Subsection "Perl 5.34"
213 There were no deprecations or fatalizations in Perl 5.34.
214 .SS "Perl 5.32"
215 .IX Subsection "Perl 5.32"
216 \fIConstants from lexical variables potentially modified elsewhere\fR
217 .IX Subsection "Constants from lexical variables potentially modified elsewhere"
218 .PP
219 You wrote something like
220 .PP
221 .Vb 2
222 \& my $var;
223 \& $sub = sub () { $var };
224 .Ve
225 .PP
226 but \f(CW$var\fR is referenced elsewhere and could be modified after the \f(CW\*(C`sub\*(C'\fR
227 expression is evaluated. Either it is explicitly modified elsewhere
228 (\f(CW\*(C`$var = 3\*(C'\fR) or it is passed to a subroutine or to an operator like
229 \&\f(CW\*(C`printf\*(C'\fR or \f(CW\*(C`map\*(C'\fR, which may or may not modify the variable.
230 .PP
231 Traditionally, Perl has captured the value of the variable at that
232 point and turned the subroutine into a constant eligible for inlining.
233 In those cases where the variable can be modified elsewhere, this
234 breaks the behavior of closures, in which the subroutine captures
235 the variable itself, rather than its value, so future changes to the
236 variable are reflected in the subroutine's return value.
237 .PP
238 If you intended for the subroutine to be eligible for inlining, then
239 make sure the variable is not referenced elsewhere, possibly by
240 copying it:
241 .PP
242 .Vb 2
243 \& my $var2 = $var;
244 \& $sub = sub () { $var2 };
245 .Ve
246 .PP
247 If you do want this subroutine to be a closure that reflects future
248 changes to the variable that it closes over, add an explicit \f(CW\*(C`return\*(C'\fR:
249 .PP
250 .Vb 2
251 \& my $var;
252 \& $sub = sub () { return $var };
253 .Ve
254 .PP
255 This usage was deprecated and as of Perl 5.32 is no longer allowed.
256 .PP
257 \fIUse of strings with code points over 0xFF as arguments to \fR\f(CI\*(C`vec\*(C'\fR
258 .IX Subsection "Use of strings with code points over 0xFF as arguments to vec"
259 .PP
260 \&\f(CW\*(C`vec\*(C'\fR views its string argument as a sequence of bits. A string
261 containing a code point over 0xFF is nonsensical. This usage is
262 deprecated in Perl 5.28, and was removed in Perl 5.32.
263 .PP
264 \fIUse of code points over 0xFF in string bitwise operators\fR
265 .IX Subsection "Use of code points over 0xFF in string bitwise operators"
266 .PP
267 The string bitwise operators, \f(CW\*(C`&\*(C'\fR, \f(CW\*(C`|\*(C'\fR, \f(CW\*(C`^\*(C'\fR, and \f(CW\*(C`~\*(C'\fR, treat their
268 operands as strings of bytes. As such, values above 0xFF are
269 nonsensical. Some instances of these have been deprecated since Perl
270 5.24, and were made fatal in 5.28, but it turns out that in cases where
271 the wide characters did not affect the end result, no deprecation
272 notice was raised, and so remain legal. Now, all occurrences either are
273 fatal or raise a deprecation warning, so that the remaining legal
274 occurrences became fatal in 5.32.
275 .PP
276 An example of this is
277 .PP
278 .Vb 1
279 \& "" & "\ex{100}"
280 .Ve
281 .PP
282 The wide character is not used in the \f(CW\*(C`&\*(C'\fR operation because the left
283 operand is shorter. This now throws an exception.
284 .PP
285 \fR\f(BIhostname()\fR\fI doesn't accept any arguments\fR
286 .IX Subsection "hostname() doesn't accept any arguments"
287 .PP
288 The function \f(CWhostname()\fR in the Sys::Hostname module has always
289 been documented to be called with no arguments. Historically it has not
290 enforced this, and has actually accepted and ignored any arguments. As a
291 result, some users have got the mistaken impression that an argument does
292 something useful. To avoid these bugs, the function is being made strict.
293 Passing arguments was deprecated in Perl 5.28 and became fatal in Perl 5.32.
294 .PP
295 \fIUnescaped left braces in regular expressions\fR
296 .IX Subsection "Unescaped left braces in regular expressions"
297 .PP
298 The simple rule to remember, if you want to match a literal \f(CW\*(C`{\*(C'\fR
299 character (U+007B \f(CW\*(C`LEFT CURLY BRACKET\*(C'\fR) in a regular expression
300 pattern, is to escape each literal instance of it in some way.
301 Generally easiest is to precede it with a backslash, like \f(CW\*(C`\e{\*(C'\fR
302 or enclose it in square brackets (\f(CW\*(C`[{]\*(C'\fR). If the pattern
303 delimiters are also braces, any matching right brace (\f(CW\*(C`}\*(C'\fR) should
304 also be escaped to avoid confusing the parser, for example,
305 .PP
306 .Vb 1
307 \& qr{abc\e{def\e}ghi}
308 .Ve
309 .PP
310 Forcing literal \f(CW\*(C`{\*(C'\fR characters to be escaped will enable the Perl
311 language to be extended in various ways in future releases. To avoid
312 needlessly breaking existing code, the restriction is not enforced in
313 contexts where there are unlikely to ever be extensions that could
314 conflict with the use of \f(CW\*(C`{\*(C'\fR as a literal. A non-deprecation
315 warning that the left brace is being taken literally is raised in
316 contexts where there could be confusion about it.
317 .PP
318 Literal uses of \f(CW\*(C`{\*(C'\fR were deprecated in Perl 5.20, and some uses of it
319 started to give deprecation warnings since. These cases were made fatal
320 in Perl 5.26. Due to an oversight, not all cases of a use of a literal
321 \&\f(CW\*(C`{\*(C'\fR got a deprecation warning. Some cases started warning in Perl 5.26,
322 and were made fatal in Perl 5.30. Other cases started in Perl 5.28,
323 and were made fatal in 5.32.
324 .PP
325 \fIIn XS code, use of various macros dealing with UTF\-8\fR
326 .IX Subsection "In XS code, use of various macros dealing with UTF-8"
327 .PP
328 The macros below now require an extra parameter compared to versions prior
329 to Perl 5.32. The final parameter in each one is a pointer into the
330 string supplied by the first parameter beyond which the input will not
331 be read. This prevents potential reading beyond the end of the buffer.
332 \&\f(CW\*(C`isALPHANUMERIC_utf8\*(C'\fR,
333 \&\f(CW\*(C`isASCII_utf8\*(C'\fR,
334 \&\f(CW\*(C`isBLANK_utf8\*(C'\fR,
335 \&\f(CW\*(C`isCNTRL_utf8\*(C'\fR,
336 \&\f(CW\*(C`isDIGIT_utf8\*(C'\fR,
337 \&\f(CW\*(C`isIDFIRST_utf8\*(C'\fR,
338 \&\f(CW\*(C`isPSXSPC_utf8\*(C'\fR,
339 \&\f(CW\*(C`isSPACE_utf8\*(C'\fR,
340 \&\f(CW\*(C`isVERTWS_utf8\*(C'\fR,
341 \&\f(CW\*(C`isWORDCHAR_utf8\*(C'\fR,
342 \&\f(CW\*(C`isXDIGIT_utf8\*(C'\fR,
343 \&\f(CW\*(C`isALPHANUMERIC_LC_utf8\*(C'\fR,
344 \&\f(CW\*(C`isALPHA_LC_utf8\*(C'\fR,
345 \&\f(CW\*(C`isASCII_LC_utf8\*(C'\fR,
346 \&\f(CW\*(C`isBLANK_LC_utf8\*(C'\fR,
347 \&\f(CW\*(C`isCNTRL_LC_utf8\*(C'\fR,
348 \&\f(CW\*(C`isDIGIT_LC_utf8\*(C'\fR,
349 \&\f(CW\*(C`isGRAPH_LC_utf8\*(C'\fR,
350 \&\f(CW\*(C`isIDCONT_LC_utf8\*(C'\fR,
351 \&\f(CW\*(C`isIDFIRST_LC_utf8\*(C'\fR,
352 \&\f(CW\*(C`isLOWER_LC_utf8\*(C'\fR,
353 \&\f(CW\*(C`isPRINT_LC_utf8\*(C'\fR,
354 \&\f(CW\*(C`isPSXSPC_LC_utf8\*(C'\fR,
355 \&\f(CW\*(C`isPUNCT_LC_utf8\*(C'\fR,
356 \&\f(CW\*(C`isSPACE_LC_utf8\*(C'\fR,
357 \&\f(CW\*(C`isUPPER_LC_utf8\*(C'\fR,
358 \&\f(CW\*(C`isWORDCHAR_LC_utf8\*(C'\fR,
359 \&\f(CW\*(C`isXDIGIT_LC_utf8\*(C'\fR,
360 \&\f(CW\*(C`toFOLD_utf8\*(C'\fR,
361 \&\f(CW\*(C`toLOWER_utf8\*(C'\fR,
362 \&\f(CW\*(C`toTITLE_utf8\*(C'\fR,
363 and
364 \&\f(CW\*(C`toUPPER_utf8\*(C'\fR.
365 .PP
366 Since Perl 5.26, this functionality with the extra parameter has been
367 available by using a corresponding macro to each one of these, and whose
368 name is formed by appending \f(CW\*(C`_safe\*(C'\fR to the base name. There is no
369 change to the functionality of those. For example, \f(CW\*(C`isDIGIT_utf8_safe\*(C'\fR
370 corresponds to \f(CW\*(C`isDIGIT_utf8\*(C'\fR, and both now behave identically. All
371 are documented in "Character case changing" in perlapi and
372 "Character classification" in perlapi.
373 .PP
374 This change was originally scheduled for 5.30, but was delayed until
375 5.32.
376 .PP
377 \fR\f(CIFile::Glob::glob()\fR\fI was removed\fR
378 .IX Subsection "File::Glob::glob() was removed"
379 .PP
380 \&\f(CW\*(C`File::Glob\*(C'\fR had a function called \f(CW\*(C`glob\*(C'\fR, which just called
381 \&\f(CW\*(C`bsd_glob\*(C'\fR.
382 .PP
383 \&\f(CWFile::Glob::glob()\fR was deprecated in Perl 5.8. A deprecation
384 message was issued from Perl 5.26 onwards, the function became fatal
385 in Perl 5.30, and was removed entirely in Perl 5.32.
386 .PP
387 Code using \f(CWFile::Glob::glob()\fR should call
388 \&\f(CWFile::Glob::bsd_glob()\fR instead.
389 .SS "Perl 5.30"
390 .IX Subsection "Perl 5.30"
391 \fR\f(CI$*\fR\fI is no longer supported\fR
392 .IX Subsection "$* is no longer supported"
393 .PP
394 Before Perl 5.10, setting \f(CW$*\fR to a true value globally enabled
395 multi-line matching within a string. This relic from the past lost
396 its special meaning in 5.10. Use of this variable became a fatal error
397 in Perl 5.30, freeing the variable up for a future special meaning.
398 .PP
399 To enable multiline matching one should use the \f(CW\*(C`/m\*(C'\fR regexp
400 modifier (possibly in combination with \f(CW\*(C`/s\*(C'\fR). This can be set
401 on a per match basis, or can be enabled per lexical scope (including
402 a whole file) with \f(CW\*(C`use re \*(Aq/m\*(Aq\*(C'\fR.
403 .PP
404 \fR\f(CI$#\fR\fI is no longer supported\fR
405 .IX Subsection "$# is no longer supported"
406 .PP
407 This variable used to have a special meaning \-\- it could be used
408 to control how numbers were formatted when printed. This seldom
409 used functionality was removed in Perl 5.10. In order to free up
410 the variable for a future special meaning, its use became a fatal
411 error in Perl 5.30.
412 .PP
413 To specify how numbers are formatted when printed, one is advised
414 to use \f(CW\*(C`printf\*(C'\fR or \f(CW\*(C`sprintf\*(C'\fR instead.
415 .PP
416 \fIAssigning non-zero to \fR\f(CI$[\fR\fI is fatal\fR
417 .IX Subsection "Assigning non-zero to $[ is fatal"
418 .PP
419 This variable (and the corresponding \f(CW\*(C`array_base\*(C'\fR feature and
420 arybase module) allowed changing the base for array and string
421 indexing operations.
422 .PP
423 Setting this to a non-zero value has been deprecated since Perl 5.12 and
424 throws a fatal error as of Perl 5.30.
425 .PP
426 \fIUnqualified \fR\f(CIdump()\fR
427 .IX Subsection "Unqualified dump()"
428 .PP
429 Use of \f(CWdump()\fR instead of \f(CWCORE::dump()\fR was deprecated in Perl 5.8,
430 and an unqualified \f(CWdump()\fR is no longer available as of Perl 5.30.
431 .PP
432 See "dump" in perlfunc.
433 .PP
434 \fIUsing \fR\f(BImy()\fR\fI in false conditional\fR
435 .IX Subsection "Using my() in false conditional"
436 .PP
437 There has been a long-standing bug in Perl that causes a lexical variable
438 not to be cleared at scope exit when its declaration includes a false
439 conditional. Some people have exploited this bug to achieve a kind of
440 static variable. To allow us to fix this bug, people should not be
441 relying on this behavior.
442 .PP
443 Instead, it's recommended one uses \f(CW\*(C`state\*(C'\fR variables to achieve the
444 same effect:
445 .PP
446 .Vb 4
447 \& use 5.10.0;
448 \& sub count {state $counter; return ++ $counter}
449 \& say count (); # Prints 1
450 \& say count (); # Prints 2
451 .Ve
452 .PP
453 \&\f(CW\*(C`state\*(C'\fR variables were introduced in Perl 5.10.
454 .PP
455 Alternatively, you can achieve a similar static effect by
456 declaring the variable in a separate block outside the function, e.g.,
457 .PP
458 .Vb 1
459 \& sub f { my $x if 0; return $x++ }
460 .Ve
461 .PP
462 becomes
463 .PP
464 .Vb 1
465 \& { my $x; sub f { return $x++ } }
466 .Ve
467 .PP
468 The use of \f(CWmy()\fR in a false conditional has been deprecated in
469 Perl 5.10, and became a fatal error in Perl 5.30.
470 .PP
471 \fIReading/writing bytes from/to :utf8 handles\fR
472 .IX Subsection "Reading/writing bytes from/to :utf8 handles"
473 .PP
474 The \fBsysread()\fR, \fBrecv()\fR, \fBsyswrite()\fR and \fBsend()\fR operators are
475 deprecated on handles that have the \f(CW\*(C`:utf8\*(C'\fR layer, either explicitly, or
476 implicitly, eg., with the \f(CW:encoding(UTF\-16LE)\fR layer.
477 .PP
478 Both \fBsysread()\fR and \fBrecv()\fR currently use only the \f(CW\*(C`:utf8\*(C'\fR flag for the stream,
479 ignoring the actual layers. Since \fBsysread()\fR and \fBrecv()\fR do no UTF\-8
480 validation they can end up creating invalidly encoded scalars.
481 .PP
482 Similarly, \fBsyswrite()\fR and \fBsend()\fR use only the \f(CW\*(C`:utf8\*(C'\fR flag, otherwise ignoring
483 any layers. If the flag is set, both write the value UTF\-8 encoded, even if
484 the layer is some different encoding, such as the UTF\-16LE example above.
485 .PP
486 Ideally, all of these operators would completely ignore the \f(CW\*(C`:utf8\*(C'\fR state,
487 working only with bytes, but this would result in silently breaking existing
488 code. To avoid this a future version of perl will throw an exception when
489 any of \fBsysread()\fR, \fBrecv()\fR, \fBsyswrite()\fR or \fBsend()\fR are called on handles with the
490 \&\f(CW\*(C`:utf8\*(C'\fR layer.
491 .PP
492 As of Perl 5.30, it is no longer possible to use \fBsysread()\fR, \fBrecv()\fR,
493 \&\fBsyswrite()\fR or \fBsend()\fR to read or send bytes from/to \f(CW\*(C`:utf8\*(C'\fR handles.
494 .PP
495 \fIUse of unassigned code point or non-standalone grapheme for a delimiter\fR
496 .IX Subsection "Use of unassigned code point or non-standalone grapheme for a delimiter"
497 .PP
498 A grapheme is what appears to a native speaker of a language to be a
499 character. In Unicode (and hence Perl) a grapheme may actually be
500 several adjacent characters that together form a complete grapheme. For
501 example, there can be a base character, like "R" and an accent, like a
502 circumflex "^", that appear to be a single character when displayed,
503 with the circumflex hovering over the "R".
504 .PP
505 As of Perl 5.30, use of delimiters which are non-standalone graphemes is
506 fatal, in order to move the language to be able to accept
507 multi-character graphemes as delimiters.
508 .PP
509 Also, as of Perl 5.30, delimiters which are unassigned code points
510 but that may someday become assigned are prohibited. Otherwise, code
511 that works today would fail to compile if the currently unassigned
512 delimiter ends up being something that isn't a stand-alone grapheme.
513 Because Unicode is never going to assign non-character code
514 points, nor code points that are
515 above the legal Unicode maximum, those can be delimiters.
516 .SS "Perl 5.28"
517 .IX Subsection "Perl 5.28"
518 \fIAttributes \fR\f(CI\*(C`:locked\*(C'\fR\fI and \fR\f(CI\*(C`:unique\*(C'\fR
519 .IX Subsection "Attributes :locked and :unique"
520 .PP
521 The attributes \f(CW\*(C`:locked\*(C'\fR (on code references) and \f(CW\*(C`:unique\*(C'\fR
522 (on array, hash and scalar references) have had no effect since
523 Perl 5.005 and Perl 5.8.8 respectively. Their use has been deprecated
524 since.
525 .PP
526 As of Perl 5.28, these attributes are syntax errors. Since the
527 attributes do not do anything, removing them from your code fixes
528 the syntax error; and removing them will not influence the behaviour
529 of your code.
530 .PP
531 \fIBare here-document terminators\fR
532 .IX Subsection "Bare here-document terminators"
533 .PP
534 Perl has allowed you to use a bare here-document terminator \f(CW\*(C`<<\*(C'\fR to
535 have the here-document end at the first empty line. This practise was
536 deprecated in Perl 5.000; as of Perl 5.28, using a bare here-document
537 terminator throws a fatal error.
538 .PP
539 You are encouraged to use the explicitly quoted form if you wish to
540 use an empty line as the terminator of the here-document:
541 .PP
542 .Vb 2
543 \& print <<"";
544 \& Print this line.
545 \&
546 \& # Previous blank line ends the here\-document.
547 .Ve
548 .PP
549 \fISetting $/ to a reference to a non-positive integer\fR
550 .IX Subsection "Setting $/ to a reference to a non-positive integer"
551 .PP
552 You assigned a reference to a scalar to \f(CW$/\fR where the
553 referenced item is not a positive integer. In older perls this \fBappeared\fR
554 to work the same as setting it to \f(CW\*(C`undef\*(C'\fR but was in fact internally
555 different, less efficient and with very bad luck could have resulted in
556 your file being split by a stringified form of the reference.
557 .PP
558 In Perl 5.20.0 this was changed so that it would be \fBexactly\fR the same as
559 setting \f(CW$/\fR to \f(CW\*(C`undef\*(C'\fR, with the exception that this warning would be
560 thrown.
561 .PP
562 As of Perl 5.28, setting \f(CW$/\fR to a reference to a non-positive
563 integer throws a fatal error.
564 .PP
565 You are recommended to change your code to set \f(CW$/\fR to \f(CW\*(C`undef\*(C'\fR explicitly
566 if you wish to slurp the file.
567 .PP
568 \fILimit on the value of Unicode code points\fR
569 .IX Subsection "Limit on the value of Unicode code points"
570 .PP
571 Unicode only allows code points up to 0x10FFFF, but Perl allows
572 much larger ones. Up till Perl 5.28, it was allowed to use code
573 points exceeding the maximum value of an integer (\f(CW\*(C`IV_MAX\*(C'\fR).
574 However, that did break the perl interpreter in some constructs,
575 including causing it to hang in a few cases. The known problem
576 areas were in \f(CW\*(C`tr///\*(C'\fR, regular expression pattern matching using
577 quantifiers, as quote delimiters in \f(CW\*(C`q\fR\f(CIX\fR\f(CW...\fR\f(CIX\fR\f(CW\*(C'\fR (where \fIX\fR is
578 the \f(CWchr()\fR of a large code point), and as the upper limits in
579 loops.
580 .PP
581 The use of out of range code points was deprecated in Perl 5.24; as of
582 Perl 5.28 using a code point exceeding \f(CW\*(C`IV_MAX\*(C'\fR throws a fatal error.
583 .PP
584 If your code is to run on various platforms, keep in mind that the upper
585 limit depends on the platform. It is much larger on 64\-bit word sizes
586 than 32\-bit ones. For 32\-bit integers, \f(CW\*(C`IV_MAX\*(C'\fR equals \f(CW0x7FFFFFFF\fR;
587 for 64\-bit integers, \f(CW\*(C`IV_MAX\*(C'\fR equals \f(CW0x7FFFFFFFFFFFFFFF\fR.
588 .PP
589 \fIUse of comma-less variable list in formats\fR
590 .IX Subsection "Use of comma-less variable list in formats"
591 .PP
592 It was allowed to use a list of variables in a format, without
593 separating them with commas. This usage has been deprecated
594 for a long time, and as of Perl 5.28, this throws a fatal error.
595 .PP
596 \fIUse of \fR\f(CI\*(C`\eN{}\*(C'\fR
597 .IX Subsection "Use of N{}"
598 .PP
599 Use of \f(CW\*(C`\eN{}\*(C'\fR with nothing between the braces was deprecated in
600 Perl 5.24, and throws a fatal error as of Perl 5.28.
601 .PP
602 Since such a construct is equivalent to using an empty string,
603 you are recommended to remove such \f(CW\*(C`\eN{}\*(C'\fR constructs.
604 .PP
605 \fIUsing the same symbol to open a filehandle and a dirhandle\fR
606 .IX Subsection "Using the same symbol to open a filehandle and a dirhandle"
607 .PP
608 It used to be legal to use \f(CWopen()\fR to associate both a
609 filehandle and a dirhandle to the same symbol (glob or scalar).
610 This idiom is likely to be confusing, and it was deprecated in
611 Perl 5.10.
612 .PP
613 Using the same symbol to \f(CWopen()\fR a filehandle and a dirhandle
614 throws a fatal error as of Perl 5.28.
615 .PP
616 You should be using two different symbols instead.
617 .PP
618 \fI${^ENCODING} is no longer supported\fR
619 .IX Subsection "${^ENCODING} is no longer supported"
620 .PP
621 The special variable \f(CW\*(C`${^ENCODING}\*(C'\fR was used to implement
622 the \f(CW\*(C`encoding\*(C'\fR pragma. Setting this variable to anything other
623 than \f(CW\*(C`undef\*(C'\fR was deprecated in Perl 5.22. Full deprecation
624 of the variable happened in Perl 5.25.3.
625 .PP
626 Setting this variable to anything other than an undefined value
627 throws a fatal error as of Perl 5.28.
628 .PP
629 \fR\f(CI\*(C`B::OP::terse\*(C'\fR\fI\fR
630 .IX Subsection "B::OP::terse"
631 .PP
632 This method, which just calls \f(CW\*(C`B::Concise::b_terse\*(C'\fR, has been
633 deprecated, and disappeared in Perl 5.28. Please use
634 B::Concise instead.
635 .PP
636 \fIUse of inherited AUTOLOAD for non-method \fR\f(CI%s::\fR\fI%s() is no longer allowed\fR
637 .IX Subsection "Use of inherited AUTOLOAD for non-method %s::%s() is no longer allowed"
638 .PP
639 As an (ahem) accidental feature, \f(CW\*(C`AUTOLOAD\*(C'\fR subroutines were looked
640 up as methods (using the \f(CW@ISA\fR hierarchy) even when the subroutines
641 to be autoloaded were called as plain functions (e.g. \f(CWFoo::bar()\fR),
642 not as methods (e.g. \f(CW\*(C`Foo\->bar()\*(C'\fR or \f(CW\*(C`$obj\->bar()\*(C'\fR).
643 .PP
644 This bug was deprecated in Perl 5.004 and has been rectified in Perl 5.28
645 by using method lookup only for methods' \f(CW\*(C`AUTOLOAD\*(C'\fRs.
646 .PP
647 The simple rule is: Inheritance will not work when autoloading
648 non-methods. The simple fix for old code is: In any module that used
649 to depend on inheriting \f(CW\*(C`AUTOLOAD\*(C'\fR for non-methods from a base class
650 named \f(CW\*(C`BaseClass\*(C'\fR, execute \f(CW\*(C`*AUTOLOAD = \e&BaseClass::AUTOLOAD\*(C'\fR during
651 startup.
652 .PP
653 In code that currently says \f(CW\*(C`use AutoLoader; @ISA = qw(AutoLoader);\*(C'\fR
654 you should remove AutoLoader from \f(CW@ISA\fR and change \f(CW\*(C`use AutoLoader;\*(C'\fR to
655 \&\f(CW\*(C`use AutoLoader \*(AqAUTOLOAD\*(Aq;\*(C'\fR.
656 .PP
657 \fIIn XS code, use of \fR\f(CIto_utf8_case()\fR
658 .IX Subsection "In XS code, use of to_utf8_case()"
659 .PP
660 This function has been removed as of Perl 5.28; instead convert to call
661 the appropriate one of:
662 \&\f(CW\*(C`toFOLD_utf8_safe\*(C'\fR.
663 \&\f(CW\*(C`toLOWER_utf8_safe\*(C'\fR,
664 \&\f(CW\*(C`toTITLE_utf8_safe\*(C'\fR,
665 or
666 \&\f(CW\*(C`toUPPER_utf8_safe\*(C'\fR.
667 .SS "Perl 5.26"
668 .IX Subsection "Perl 5.26"
669 \fR\f(CI\*(C`\-\-libpods\*(C'\fR\fI in \fR\f(CI\*(C`Pod::Html\*(C'\fR\fI\fR
670 .IX Subsection "--libpods in Pod::Html"
671 .PP
672 Since Perl 5.18, the option \f(CW\*(C`\-\-libpods\*(C'\fR has been deprecated, and
673 using this option did not do anything other than producing a warning.
674 .PP
675 The \f(CW\*(C`\-\-libpods\*(C'\fR option is no longer recognized as of Perl 5.26.
676 .PP
677 \fIThe utilities \fR\f(CI\*(C`c2ph\*(C'\fR\fI and \fR\f(CI\*(C`pstruct\*(C'\fR
678 .IX Subsection "The utilities c2ph and pstruct"
679 .PP
680 These old, perl3\-era utilities have been deprecated in favour of
681 \&\f(CW\*(C`h2xs\*(C'\fR for a long time. As of Perl 5.26, they have been removed.
682 .PP
683 \fITrapping \fR\f(CI$SIG{_\|_DIE_\|_}\fR\fI other than during program exit\fR
684 .IX Subsection "Trapping $SIG{__DIE__} other than during program exit"
685 .PP
686 The \f(CW$SIG{_\|_DIE_\|_}\fR hook is called even inside an \f(CWeval()\fR. It was
687 never intended to happen this way, but an implementation glitch made
688 this possible. This used to be deprecated, as it allowed strange action
689 at a distance like rewriting a pending exception in \f(CW$@\fR. Plans to
690 rectify this have been scrapped, as users found that rewriting a
691 pending exception is actually a useful feature, and not a bug.
692 .PP
693 Perl never issued a deprecation warning for this; the deprecation
694 was by documentation policy only. But this deprecation has been
695 lifted as of Perl 5.26.
696 .PP
697 \fIMalformed UTF\-8 string in "%s"\fR
698 .IX Subsection "Malformed UTF-8 string in ""%s"""
699 .PP
700 This message indicates a bug either in the Perl core or in XS
701 code. Such code was trying to find out if a character, allegedly
702 stored internally encoded as UTF\-8, was of a given type, such as
703 being punctuation or a digit. But the character was not encoded
704 in legal UTF\-8. The \f(CW%s\fR is replaced by a string that can be used
705 by knowledgeable people to determine what the type being checked
706 against was.
707 .PP
708 Passing malformed strings was deprecated in Perl 5.18, and
709 became fatal in Perl 5.26.
710 .SS "Perl 5.24"
711 .IX Subsection "Perl 5.24"
712 \fIUse of \fR\f(CI*glob{FILEHANDLE}\fR
713 .IX Subsection "Use of *glob{FILEHANDLE}"
714 .PP
715 The use of \f(CW*glob{FILEHANDLE}\fR was deprecated in Perl 5.8.
716 The intention was to use \f(CW*glob{IO}\fR instead, for which
717 \&\f(CW*glob{FILEHANDLE}\fR is an alias.
718 .PP
719 However, this feature was undeprecated in Perl 5.24.
720 .PP
721 \fICalling POSIX::%s() is deprecated\fR
722 .IX Subsection "Calling POSIX::%s() is deprecated"
723 .PP
724 The following functions in the \f(CW\*(C`POSIX\*(C'\fR module are no longer available:
725 \&\f(CW\*(C`isalnum\*(C'\fR, \f(CW\*(C`isalpha\*(C'\fR, \f(CW\*(C`iscntrl\*(C'\fR, \f(CW\*(C`isdigit\*(C'\fR, \f(CW\*(C`isgraph\*(C'\fR, \f(CW\*(C`islower\*(C'\fR,
726 \&\f(CW\*(C`isprint\*(C'\fR, \f(CW\*(C`ispunct\*(C'\fR, \f(CW\*(C`isspace\*(C'\fR, \f(CW\*(C`isupper\*(C'\fR, and \f(CW\*(C`isxdigit\*(C'\fR. The
727 functions are buggy and don't work on UTF\-8 encoded strings. See their
728 entries in POSIX for more information.
729 .PP
730 The functions were deprecated in Perl 5.20, and removed in Perl 5.24.
731 .SS "Perl 5.16"
732 .IX Subsection "Perl 5.16"
733 \fIUse of \fR\f(CI%s\fR\fI on a handle without * is deprecated\fR
734 .IX Subsection "Use of %s on a handle without * is deprecated"
735 .PP
736 It used to be possible to use \f(CW\*(C`tie\*(C'\fR, \f(CW\*(C`tied\*(C'\fR or \f(CW\*(C`untie\*(C'\fR on a scalar
737 while the scalar holds a typeglob. This caused its filehandle to be
738 tied. It left no way to tie the scalar itself when it held a typeglob,
739 and no way to untie a scalar that had had a typeglob assigned to it.
740 .PP
741 This was deprecated in Perl 5.14, and the bug was fixed in Perl 5.16.
742 .PP
743 So now \f(CW\*(C`tie $scalar\*(C'\fR will always tie the scalar, not the handle it holds.
744 To tie the handle, use \f(CW\*(C`tie *$scalar\*(C'\fR (with an explicit asterisk). The same
745 applies to \f(CW\*(C`tied *$scalar\*(C'\fR and \f(CW\*(C`untie *$scalar\*(C'\fR.
746 .SH "SEE ALSO"
747 .IX Header "SEE ALSO"
748 warnings, diagnostics.