File: perldeprecation.html

package info (click to toggle)
perl-doc-html 5.26.0-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 39,400 kB
  • sloc: xml: 36; makefile: 7
file content (918 lines) | stat: -rw-r--r-- 47,301 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <title>perldeprecation - perldoc.perl.org</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta http-equiv="Content-Language" content="en-gb">
  <link rel="search" type="application/opensearchdescription+xml" title="Search perldoc.perl.org" href="/static/search.xml"/>
  <link href="static/css-20100830.css" rel="stylesheet" rev="stylesheet" type="text/css" media="screen">
  <link href="static/exploreperl.css" rel="stylesheet" rev="stylesheet" type="text/css">
</head>

<body onLoad="perldoc.startup();" onPageShow="if (event.persisted) perldoc.startup();">
    <div id="page">
      
      <div id="header">
	<div id="homepage_link">
	  <a href="index.html"></a>
	</div>
	<div id="strapline">
	  Perl Programming Documentation
	</div>
	<div id="download_link" class="download">
	  <a href="http://www.perl.org/get.html">Download Perl</a>
	</div>
	<div id="explore_link" class="download">
	  <a id="explore_anchor" href="#">Explore</a>
	</div>
      </div>
      
      <div id="body">
        <div id="left_column">
          <div class="side_group">
            
	    <div class="side_panel doc_panel">
              <p>Manual</p>
              <ul>
                <li><a href="index-overview.html">Overview</a>
                <li><a href="index-tutorials.html">Tutorials</a>
                <li><a href="index-faq.html">FAQs</a>
                <li><a href="index-history.html">History / Changes</a>
                <li><a href="index-licence.html">License</a>
              </ul>
            </div>
            <div class="side_panel doc_panel">
              <p>Reference</p>
              <ul>
                <li><a href="index-language.html">Language</a>
                <li><a href="index-functions.html">Functions</a>
                <li><a href="perlop.html">Operators</a>
                <li><a href="perlvar.html">Special Variables</a>
                <li><a href="index-pragmas.html">Pragmas</a>
                <li><a href="index-utilities.html">Utilities</a>
                <li><a href="index-internals.html">Internals</a>
                <li><a href="index-platforms.html">Platform Specific</a>
              </ul>
            </div>
            <div class="side_panel doc_panel">
              <p>Modules</p>
              <ul>
		<li>
		
                
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		
                  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		
                  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		
                  
		
                  
		    
		  
		
                  
		
                  
		
		
                    <a href="index-modules-A.html">A</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-B.html">B</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-C.html">C</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-D.html">D</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-E.html">E</a>
                    
                      
                        <li>
                      
                    
                
                    <a href="index-modules-F.html">F</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-G.html">G</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-H.html">H</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-I.html">I</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-L.html">L</a>
                    
                      
                        <li>
                      
                    
                
                    <a href="index-modules-M.html">M</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-N.html">N</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-O.html">O</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-P.html">P</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-S.html">S</a>
                    
                      
                        <li>
                      
                    
                
                    <a href="index-modules-T.html">T</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-U.html">U</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-X.html">X</a>
                    
                
              </ul>
            </div>
            
	      <div class="side_panel doc_panel">
		<p>Tools</p>
		<ul>
		  <li><a href="preferences.html">Preferences</a>
		</ul>
	      </div>
            
          </div>
        </div>
        <div id="centre_column">
          <div id="content_header">
            <div id="title_bar">
              <div id="page_name">
                <h1>perldeprecation</h1>
              </div>
              <div id="perl_version">
                Perl 5 version 26.0 documentation
              </div>
              <div class="page_links" id="page_links_top">
                <a href="#" onClick="toolbar.goToTop();return false;">Go to top</a>
		
              </div>
	      <div class="page_links" id="page_links_bottom">
		
                  <a href="#" id="page_index_toggle">Show page index</a> &bull;
		
                <a href="#" id="recent_pages_toggle">Show recent pages</a>		
	      </div>
	      <div id="search_form">
		<form action="search.html" method="GET" id="search">
		  <input type="text" name="q" id="search_box" alt="Search">
		</form>
	      </div>
            </div>
            <div id="breadcrumbs">
                
    <a href="index.html">Home</a> &gt;
    
      
        <a href="index-history.html">History / Changes</a> &gt;
      
    
    perldeprecation
  

            </div>
          </div>
          <div id="content_body">
	    <!--[if lt IE 7]>
 <div class="noscript">
   <p>
     <strong>It looks like you're using Internet Explorer 6. This is a very old
     browser which does not offer full support for modern websites.</strong>
   </p>
   <p>
     Unfortunately this means that this website will not work on
     your computer.
   </p>
   <p>
     Don't miss out though! To view the site (and get a better experience from
     many other websites), simply upgrade to
     <a href="http://www.microsoft.com/windows/Internet-explorer/default.aspx">Internet
Explorer 8</a>
     or download an alternative browser such as
     <a href="http://www.mozilla.com/en-US/firefox/firefox.html">Firefox</a>,
     <a href="http://www.apple.com/safari/download/">Safari</a>, or
     <a href="http://www.google.co.uk/chrome">Google Chrome</a>.
   </p>
   <p>
     All of these browsers are free. If you're using a PC at work, you may
     need to contact your IT administrator.
   </p>
 </div>
<![endif]-->
	    <noscript>
	      <div class="noscript">
	      <p>
                <strong>Please note: Many features of this site require JavaScript. You appear to have JavaScript disabled,
	        or are running a non-JavaScript capable web browser.</strong>
	      </p>
	      <p>
		To get the best experience, please enable JavaScript or download a modern web browser such as <a href="http://www.microsoft.com/windows/Internet-explorer/default.aspx">Internet Explorer 8</a>, <a href="http://www.mozilla.com/en-US/firefox/firefox.html">Firefox</a>, <a href="http://www.apple.com/safari/download/">Safari</a>, or <a href="http://www.google.co.uk/chrome">Google Chrome</a>.
              </p>
	      </div>
	    </noscript>

	    <div id="recent_pages" class="hud_container">
	      <div id="recent_pages_header" class="hud_header">
		<div id="recent_pages_close" class="hud_close"><a href="#" onClick="recentPages.hide();return false;"></a></div>
		<div id="recent_pages_title" class="hud_title"><span class="hud_span_top">Recently read</span></div>
		<div id="recent_pages_topright" class="hud_topright"></div>
	      </div>
	      <div id="recent_pages_content" class="hud_content">
	      </div>
	      <div id="recent_pages_footer" class="hud_footer">
		<div id="recent_pages_bottomleft" class="hud_bottomleft"></div>
		<div id="recent_pages_bottom" class="hud_bottom"><span class="hud_span_bottom"></span></div>
		<div id="recent_pages_resize" class="hud_resize"></div>
	      </div>
	    </div>
  
	    <div id="from_search"></div>
            <h1>perldeprecation</h1>


  <!--    -->
<ul><li><a href="#NAME">NAME</a><li><a href="#DESCRIPTION">DESCRIPTION</a><ul><li><a href="#Perl-5.32">Perl 5.32</a><li><a href="#Perl-5.30">Perl 5.30</a><li><a href="#Perl-5.28">Perl 5.28</a><li><a href="#Perl-5.26">Perl 5.26</a><li><a href="#Perl-5.24">Perl 5.24</a><li><a href="#Perl-5.16">Perl 5.16</a></ul><li><a href="#SEE-ALSO">SEE ALSO</a></ul><a name="NAME"></a><h1>NAME</h1>
<p>perldeprecation - list Perl deprecations</p>
<a name="DESCRIPTION"></a><h1>DESCRIPTION</h1>
<p>The purpose of this document is to document what has been deprecated
in Perl, and by which version the deprecated feature will disappear,
or, for already removed features, when it was removed.</p>
<p>This document will try to discuss what alternatives for the deprecated
features are available.</p>
<p>The deprecated features will be grouped by the version of Perl in
which they will be removed.</p>
<a name="Perl-5.32"></a><h2>Perl 5.32</h2>
<a name="Constants-from-lexical-variables-potentially-modified-elsewhere"></a><h3>Constants from lexical variables potentially modified elsewhere</h3>
<p>You wrote something like</p>
<pre class="verbatim"><ol><li>    <a class="l_k" href="functions/my.html">my</a> <span class="i">$var</span><span class="sc">;</span></li><li>    <span class="i">$sub</span> = <span class="i">sub ()</span> <span class="s">{</span> <span class="i">$var</span> <span class="s">}</span><span class="sc">;</span></li></ol></pre><p>but $var is referenced elsewhere and could be modified after the <code class="inline"><a class="l_k" href="functions/sub.html">sub</a></code>
expression is evaluated.  Either it is explicitly modified elsewhere
(<code class="inline"><span class="i">$var</span> = <span class="n">3</span></code>
) or it is passed to a subroutine or to an operator like
<code class="inline"><a class="l_k" href="functions/printf.html">printf</a></code> or <code class="inline"><a class="l_k" href="functions/map.html">map</a></code>, which may or may not modify the variable.</p>
<p>Traditionally, Perl has captured the value of the variable at that
point and turned the subroutine into a constant eligible for inlining.
In those cases where the variable can be modified elsewhere, this
breaks the behavior of closures, in which the subroutine captures
the variable itself, rather than its value, so future changes to the
variable are reflected in the subroutine's return value.</p>
<p>If you intended for the subroutine to be eligible for inlining, then
make sure the variable is not referenced elsewhere, possibly by
copying it:</p>
<pre class="verbatim"><ol><li>    <a class="l_k" href="functions/my.html">my</a> <span class="i">$var2</span> = <span class="i">$var</span><span class="sc">;</span></li><li>    <span class="i">$sub</span> = <span class="i">sub ()</span> <span class="s">{</span> <span class="i">$var2</span> <span class="s">}</span><span class="sc">;</span></li></ol></pre><p>If you do want this subroutine to be a closure that reflects future
changes to the variable that it closes over, add an explicit <code class="inline"><a class="l_k" href="functions/return.html">return</a></code>:</p>
<pre class="verbatim"><ol><li>    <a class="l_k" href="functions/my.html">my</a> <span class="i">$var</span><span class="sc">;</span></li><li>    <span class="i">$sub</span> = <span class="i">sub ()</span> <span class="s">{</span> <a class="l_k" href="functions/return.html">return</a> <span class="i">$var</span> <span class="s">}</span><span class="sc">;</span></li></ol></pre><p>This usage has been deprecated, and will no longer be allowed in Perl 5.32.</p>
<a name="Perl-5.30"></a><h2>Perl 5.30</h2>
<a name="%24*-is-no-longer-supported"></a><h3><code class="inline"><span class="i">$*</span></code>
 is no longer supported</h3>
<p>Before Perl 5.10, setting <code class="inline"><span class="i">$*</span></code>
 to a true value globally enabled
multi-line matching within a string. This relique from the past lost
its special meaning in 5.10. Use of this variable will be a fatal error
in Perl 5.30, freeing the variable up for a future special meaning.</p>
<p>To enable multiline matching one should use the <code class="inline">/m</code> regexp
modifier (possibly in combination with <code class="inline">/s</code>). This can be set
on a per match bases, or can be enabled per lexical scope (including
a whole file) with <code class="inline"><a class="l_k" href="functions/use.html">use</a> <span class="w">re</span> <span class="q">&#39;/m&#39;</span></code>
.</p>
<a name="%24%23-is-no-longer-supported"></a><h3><code class="inline"><span class="i">$#</span></code>
 is no longer supported</h3>
<p>This variable used to have a special meaning -- it could be used
to control how numbers were formatted when printed. This seldom
used functionality was removed in Perl 5.10. In order to free up
the variable for a future special meaning, its use will be a fatal
error in Perl 5.30.</p>
<p>To specify how numbers are formatted when printed, one is adviced
to use <code class="inline"><a class="l_k" href="functions/printf.html">printf</a></code> or <code class="inline"><a class="l_k" href="functions/sprintf.html">sprintf</a></code> instead.</p>
<a name="File%3a%3aGlob%3a%3aglob()-will-disappear"></a><h3><code class="inline"><span class="i">File::Glob::glob</span><span class="s">(</span><span class="s">)</span></code>
 will disappear</h3>
<p><code class="inline"><span class="w">File::Glob</span></code>
 has a function called <code class="inline"><a class="l_k" href="functions/glob.html">glob</a></code>, which just calls
<code class="inline"><span class="w">bsd_glob</span></code>
. However, its prototype is different from the prototype
of <code class="inline"><span class="w">CORE::glob</span></code>
, and hence, <code class="inline"><span class="w">File::Glob::glob</span></code>
 should not
be used.</p>
<p><code class="inline"><span class="i">File::Glob::glob</span><span class="s">(</span><span class="s">)</span></code>
 was deprecated in Perl 5.8. A deprecation
message was issued from Perl 5.26 onwards, and the function will
disappear in Perl 5.30.</p>
<p>Code using <code class="inline"><span class="i">File::Glob::glob</span><span class="s">(</span><span class="s">)</span></code>
 should call
<code class="inline"><span class="i">File::Glob::bsd_glob</span><span class="s">(</span><span class="s">)</span></code>
 instead.</p>
<a name="Unescaped-left-braces-in-regular-expressions"></a><h3>Unescaped left braces in regular expressions</h3>
<p>The simple rule to remember, if you want to match a literal <code class="inline">{</code>
character (U+007B <code class="inline"><span class="w">LEFT</span> <span class="w">CURLY</span> <span class="w">BRACKET</span></code>
) in a regular expression
pattern, is to escape each literal instance of it in some way.
Generally easiest is to precede it with a backslash, like <code class="inline">\{</code>
or enclose it in square brackets (<code class="inline"><span class="s">[</span><span class="s">{</span><span class="s">]</span></code>
).  If the pattern
delimiters are also braces, any matching right brace (<code class="inline">}</code>) should
also be escaped to avoid confusing the parser, for example,</p>
<pre class="verbatim"><ol><li> <span class="q">qr{abc\{def\}ghi}</span></li></ol></pre><p>Forcing literal <code class="inline">{</code> characters to be escaped will enable the Perl
language to be extended in various ways in future releases.  To avoid
needlessly breaking existing code, the restriction is is not enforced in
contexts where there are unlikely to ever be extensions that could
conflict with the use there of <code class="inline">{</code> as a literal.</p>
<p>Literal uses of <code class="inline">{</code> were deprecated in Perl 5.20, and some uses of it
started to give deprecation warnings since. These cases were made fatal
in Perl 5.26. Due to an oversight, not all cases of a use of a literal
<code class="inline">{</code> got a deprecation warning. These cases started warning in Perl 5.26,
and they will be fatal by Perl 5.30.</p>
<a name="Unqualified-dump()"></a><h3>Unqualified <code class="inline"><a class="l_k" href="functions/dump.html">dump()</a></code></h3>
<p>Use of <code class="inline"><a class="l_k" href="functions/dump.html">dump()</a></code> instead of <code class="inline"><span class="i">CORE::dump</span><span class="s">(</span><span class="s">)</span></code>
 was deprecated in Perl 5.8,
and an unqualified <code class="inline"><a class="l_k" href="functions/dump.html">dump()</a></code> will no longer be available in Perl 5.30.</p>
<p>See <a href="functions/dump.html">dump</a>.</p>
<a name="Using-my()-in-false-conditional."></a><h3>Using my() in false conditional.</h3>
<p>There has been a long-standing bug in Perl that causes a lexical variable
not to be cleared at scope exit when its declaration includes a false
conditional.  Some people have exploited this bug to achieve a kind of
static variable.  Since we intend to fix this bug, we don't want people
relying on this behavior.</p>
<p>Instead, it's recommended one uses <code class="inline"><a class="l_k" href="functions/state.html">state</a></code> variables to achieve the
same effect:</p>
<pre class="verbatim"><ol><li>    <a class="l_k" href="functions/use.html">use</a> <span class="v">5.10.0</span><span class="sc">;</span></li><li><a name="count"></a>    sub <span class="m">count</span> <span class="s">{</span><span class="w">state</span> <span class="i">$counter</span><span class="sc">;</span> <a class="l_k" href="functions/return.html">return</a> ++ <span class="i">$counter</span><span class="s">}</span></li><li>    <a class="l_k" href="functions/say.html">say</a> <span class="i">count</span> <span class="s">(</span><span class="s">)</span><span class="sc">;</span>    <span class="c"># Prints 1</span></li><li>    <a class="l_k" href="functions/say.html">say</a> <span class="i">count</span> <span class="s">(</span><span class="s">)</span><span class="sc">;</span>    <span class="c"># Prints 2</span></li></ol></pre><p><code class="inline"><a class="l_k" href="functions/state.html">state</a></code> variables were introduced in Perl 5.10.</p>
<p>Alternatively, you can achieve a similar static effect by
declaring the variable in a separate block outside the function, eg</p>
<pre class="verbatim"><ol><li><a name="f"></a>    sub <span class="m">f</span> <span class="s">{</span> <a class="l_k" href="functions/my.html">my</a> <span class="i">$x</span> if <span class="n">0</span><span class="sc">;</span> <a class="l_k" href="functions/return.html">return</a> <span class="i">$x</span>++ <span class="s">}</span></li></ol></pre><p>becomes</p>
<pre class="verbatim"><ol><li><a name="f"></a>    <span class="s">{</span> <a class="l_k" href="functions/my.html">my</a> <span class="i">$x</span><span class="sc">;</span> sub <span class="m">f</span> <span class="s">{</span> <a class="l_k" href="functions/return.html">return</a> <span class="i">$x</span>++ <span class="s">}</span> <span class="s">}</span></li></ol></pre><p>The use of <code class="inline"><a class="l_k" href="functions/my.html">my()</a></code> in a false conditional has been deprecated in
Perl 5.10, and it will become a fatal error in Perl 5.30.</p>
<a name="Reading%2fwriting-bytes-from%2fto-%3autf8-handles."></a><h3>Reading/writing bytes from/to :utf8 handles.</h3>
<p>The sysread(), recv(), syswrite() and send() operators are
deprecated on handles that have the <code class="inline"><span class="j">:</span><span class="w">utf8</span></code>
 layer, either explicitly, or
implicitly, eg., with the <code class="inline"><span class="j">:</span><span class="i">encoding</span><span class="s">(</span><span class="w">UTF</span>-<span class="n">16</span>LE<span class="s">)</span></code>
 layer.</p>
<p>Both sysread() and recv() currently use only the <code class="inline"><span class="j">:</span><span class="w">utf8</span></code>
 flag for the stream,
ignoring the actual layers.  Since sysread() and recv() do no UTF-8
validation they can end up creating invalidly encoded scalars.</p>
<p>Similarly, syswrite() and send() use only the <code class="inline"><span class="j">:</span><span class="w">utf8</span></code>
 flag, otherwise ignoring
any layers.  If the flag is set, both write the value UTF-8 encoded, even if
the layer is some different encoding, such as the example above.</p>
<p>Ideally, all of these operators would completely ignore the <code class="inline"><span class="j">:</span><span class="w">utf8</span></code>
 state,
working only with bytes, but this would result in silently breaking existing
code.  To avoid this a future version of perl will throw an exception when
any of sysread(), recv(), syswrite() or send() are called on handle with the
<code class="inline"><span class="j">:</span><span class="w">utf8</span></code>
 layer.</p>
<p>In Perl 5.30, it will no longer be possible to use sysread(), recv(),
syswrite() or send() to read or send bytes from/to :utf8 handles.</p>
<a name="Use-of-unassigned-code-point-or-non-standalone-grapheme-for-a-delimiter."></a><h3>Use of unassigned code point or non-standalone grapheme for a delimiter.</h3>
<p>A grapheme is what appears to a native-speaker of a language to be a
character.  In Unicode (and hence Perl) a grapheme may actually be
several adjacent characters that together form a complete grapheme.  For
example, there can be a base character, like "R" and an accent, like a
circumflex "^", that appear when displayed to be a single character with
the circumflex hovering over the "R".  Perl currently allows things like
that circumflex to be delimiters of strings, patterns, <i>etc</i>.  When
displayed, the circumflex would look like it belongs to the character
just to the left of it.  In order to move the language to be able to
accept graphemes as delimiters, we have to deprecate the use of
delimiters which aren't graphemes by themselves.  Also, a delimiter must
already be assigned (or known to be never going to be assigned) to try
to future-proof code, for otherwise code that works today would fail to
compile if the currently unassigned delimiter ends up being something
that isn't a stand-alone grapheme.  Because Unicode is never going to
assign
<a href="perlunicode.html#Noncharacter-code-points">non-character code points</a>, nor
<a href="perlunicode.html#Beyond-Unicode-code-points">code points that are above the legal Unicode maximum</a>, those can be delimiters, and
their use won't raise this warning.</p>
<p>In Perl 5.30, delimiters which are unassigned code points, or which
are non-standalone graphemes will be fatal.</p>
<a name="In-XS-code%2c-use-of-various-macros-dealing-with-UTF-8."></a><h3>In XS code, use of various macros dealing with UTF-8.</h3>
<p>These macros will require an extra parameter in Perl 5.30:
<code class="inline"><span class="w">isALPHANUMERIC_utf8</span></code>
,
<code class="inline"><span class="w">isASCII_utf8</span></code>
,
<code class="inline"><span class="w">isBLANK_utf8</span></code>
,
<code class="inline"><span class="w">isCNTRL_utf8</span></code>
,
<code class="inline"><span class="w">isDIGIT_utf8</span></code>
,
<code class="inline"><span class="w">isIDFIRST_utf8</span></code>
,
<code class="inline"><span class="w">isPSXSPC_utf8</span></code>
,
<code class="inline"><span class="w">isSPACE_utf8</span></code>
,
<code class="inline"><span class="w">isVERTWS_utf8</span></code>
,
<code class="inline"><span class="w">isWORDCHAR_utf8</span></code>
,
<code class="inline"><span class="w">isXDIGIT_utf8</span></code>
,
<code class="inline"><span class="w">isALPHANUMERIC_LC_utf8</span></code>
,
<code class="inline"><span class="w">isALPHA_LC_utf8</span></code>
,
<code class="inline"><span class="w">isASCII_LC_utf8</span></code>
,
<code class="inline"><span class="w">isBLANK_LC_utf8</span></code>
,
<code class="inline"><span class="w">isCNTRL_LC_utf8</span></code>
,
<code class="inline"><span class="w">isDIGIT_LC_utf8</span></code>
,
<code class="inline"><span class="w">isGRAPH_LC_utf8</span></code>
,
<code class="inline"><span class="w">isIDCONT_LC_utf8</span></code>
,
<code class="inline"><span class="w">isIDFIRST_LC_utf8</span></code>
,
<code class="inline"><span class="w">isLOWER_LC_utf8</span></code>
,
<code class="inline"><span class="w">isPRINT_LC_utf8</span></code>
,
<code class="inline"><span class="w">isPSXSPC_LC_utf8</span></code>
,
<code class="inline"><span class="w">isPUNCT_LC_utf8</span></code>
,
<code class="inline"><span class="w">isSPACE_LC_utf8</span></code>
,
<code class="inline"><span class="w">isUPPER_LC_utf8</span></code>
,
<code class="inline"><span class="w">isWORDCHAR_LC_utf8</span></code>
,
<code class="inline"><span class="w">isXDIGIT_LC_utf8</span></code>
,
<code class="inline"><span class="w">toFOLD_utf8</span></code>
,
<code class="inline"><span class="w">toLOWER_utf8</span></code>
,
<code class="inline"><span class="w">toTITLE_utf8</span></code>
,
and
<code class="inline"><span class="w">toUPPER_utf8</span></code>
.</p>
<p>There is now a macro that corresponds to each one of these, simply by
appending <code class="inline"><span class="w">_safe</span></code>
 to the name.  It takes the extra parameter.
For example, <code class="inline"><span class="w">isDIGIT_utf8_safe</span></code>
 corresponds to <code class="inline"><span class="w">isDIGIT_utf8</span></code>
, but
takes the extra parameter, and its use doesn't generate a deprecation
warning.  All are documented in <a href="perlapi.html#Character-case-changing">Character case changing in perlapi</a> and
<a href="perlapi.html#Character-classification">Character classification in perlapi</a>.</p>
<p>You can change to use these versions at any time, or, if you can live
with the deprecation messages, wait until 5.30 and add the parameter to
the existing calls, without changing the names.</p>
<a name="Perl-5.28"></a><h2>Perl 5.28</h2>
<a name="Attribute-%22%25s%22-is-deprecated%2c-and-will-disappear-in-5.28"></a><h3>Attribute "%s" is deprecated, and will disappear in 5.28</h3>
<p>The attributes <code class="inline"><span class="j">:</span><span class="w">locked</span></code>
 (on code references) and <code class="inline"><span class="j">:</span><span class="w">unique</span></code>

(on array, hash and scalar references) have had no effect since 
Perl 5.005 and Perl 5.8.8 respectively. Their use has been deprecated
since.</p>
<p>These attributes will no longer be recognized in Perl 5.28, and will
then result in a syntax error. Since the attributes do not do anything,
removing them from your code fixes the deprecation warning; and removing
them will not influence the behaviour of your code.</p>
<a name="Bare-here-document-terminators"></a><h3>Bare here-document terminators</h3>
<p>Perl has allowed you to use a bare here-document terminator to have the
here-document end at the first empty line. This practise was deprecated
in Perl 5.000, and this will be a fatal error in Perl 5.28.</p>
<p>You are encouraged to use the explictly quoted form if you wish to
use an empty line as the terminator of the here-document:</p>
<pre class="verbatim"><ol><li>  <a class="l_k" href="functions/print.html">print</a> <span class="h">&lt;&lt;&quot;&quot;</span><span class="sc">;</span></li><li><span class="hh">    Print this line.</span></li><li></li><li>  <span class="c"># Previous blank line ends the here-document.</span></li></ol></pre><a name="Setting-%24%2f-to-a-reference-to-a-non-positive-integer"></a><h3>Setting $/ to a reference to a non-positive integer</h3>
<p>You assigned a reference to a scalar to <code class="inline"><span class="i">$/</span></code>
 where the
referenced item is not a positive integer.  In older perls this <b>appeared</b>
to work the same as setting it to <code class="inline"><a class="l_k" href="functions/undef.html">undef</a></code> but was in fact internally
different, less efficient and with very bad luck could have resulted in
your file being split by a stringified form of the reference.</p>
<p>In Perl 5.20.0 this was changed so that it would be <b>exactly</b> the same as
setting <code class="inline"><span class="i">$/</span></code>
 to undef, with the exception that this warning would be
thrown.</p>
<p>In Perl 5.28, this will throw a fatal error.</p>
<p>You are recommended to change your code to set <code class="inline"><span class="i">$/</span></code>
 to <code class="inline"><a class="l_k" href="functions/undef.html">undef</a></code> explicitly
if you wish to slurp the file.</p>
<a name="Limit-on-the-value-of-Unicode-code-points."></a><h3>Limit on the value of Unicode code points.</h3>
<p>Unicode only allows code points up to 0x10FFFF, but Perl allows much
larger ones. However, using code points exceeding the maximum value
of an integer (<code class="inline"><span class="w">IV_MAX</span></code>
) may break the perl interpreter in some constructs,
including causing it to hang in a few cases.  The known problem areas
are in <code class="inline"><a class="l_k" href="functions/tr.html">tr///</a></code>, regular expression pattern matching using quantifiers,
as quote delimiters in <code class="inline">q<i>X</i>...<i>X</i></code> (where <i>X</i> is the <code class="inline"><a class="l_k" href="functions/chr.html">chr()</a></code> of a large
code point), and as the upper limits in loops.</p>
<p>The use of out of range code points was deprecated in Perl 5.24, and
it will be a fatal error in Perl 5.28.</p>
<p>If your code is to run on various platforms, keep in mind that the upper
limit depends on the platform.  It is much larger on 64-bit word sizes
than 32-bit ones.</p>
<a name="Use-of-comma-less-variable-list-in-formats."></a><h3>Use of comma-less variable list in formats.</h3>
<p>It's allowed to use a list of variables in a format, without
separating them with commas. This usage has been deprecated
for a long time, and it will be a fatal error in Perl 5.28.</p>
<a name="Use-of-%5cN%7b%7d"></a><h3>Use of <code class="inline">\<span class="w">N</span><span class="s">{</span><span class="s">}</span></code>
</h3>
<p>Use of <code class="inline">\<span class="w">N</span><span class="s">{</span><span class="s">}</span></code>
 with nothing between the braces was deprecated in
Perl 5.24, and will throw a fatal error in Perl 5.28.</p>
<p>Since such a construct is equivalent to using an empty string,
you are recommended to remove such <code class="inline">\<span class="w">N</span><span class="s">{</span><span class="s">}</span></code>
 constructs.</p>
<a name="Using-the-same-symbol-to-open-a-filehandle-and-a-dirhandle"></a><h3>Using the same symbol to open a filehandle and a dirhandle</h3>
<p>It used to be legal to use <code class="inline"><a class="l_k" href="functions/open.html">open()</a></code> to associate both a
filehandle and a dirhandle to the same symbol (glob or scalar).
This idiom is likely to be confusing, and it was deprecated in
Perl 5.10.</p>
<p>Using the same symbol to <code class="inline"><a class="l_k" href="functions/open.html">open()</a></code> a filehandle and a dirhandle
will be a fatal error in Perl 5.28.</p>
<p>You should be using two different symbols instead.</p>
<a name="%24%7b%5eENCODING%7d-is-no-longer-supported."></a><h3>${^ENCODING} is no longer supported.</h3>
<p>The special variable <code class="inline"><span class="i">$</span>{<span class="w">^ENCODING</span>}</code>
 was used to implement
the <code class="inline"><span class="w">encoding</span></code>
 pragma. Setting this variable to anything other
than <code class="inline"><a class="l_k" href="functions/undef.html">undef</a></code> was deprecated in Perl 5.22. Full deprecation
of the variable happened in Perl 5.25.3.</p>
<p>Setting this variable will become a fatal error in Perl 5.28.</p>
<a name="B%3a%3aOP%3a%3aterse"></a><h3><code class="inline"><span class="w">B::OP::terse</span></code>
</h3>
<p>This method, which just calls <code class="inline"><span class="w">B::Concise::b_terse</span></code>
, has been
deprecated, and will disappear in Perl 5.28. Please use 
<code class="inline"><span class="w">B::Concise</span></code>
 instead.</p>
<a name="Use-of-inherited-AUTOLOAD-for-non-method-%25s()-is-deprecated"></a><h3>Use of inherited AUTOLOAD for non-method %s() is deprecated</h3>
<p>As an (ahem) accidental feature, <code class="inline">AUTOLOAD</code>
 subroutines are looked
up as methods (using the <code class="inline"><span class="i">@ISA</span></code>
 hierarchy) even when the subroutines
to be autoloaded were called as plain functions (e.g. <code class="inline"><span class="i">Foo::bar</span><span class="s">(</span><span class="s">)</span></code>
),
not as methods (e.g. <code class="inline"><span class="w">Foo</span><span class="w">-&gt;bar</span><span class="s">(</span><span class="s">)</span></code>
 or <code class="inline"><span class="i">$obj</span><span class="i">-&gt;bar</span><span class="s">(</span><span class="s">)</span></code>
).</p>
<p>This bug will be rectified in future by using method lookup only for
methods' <code class="inline">AUTOLOAD</code>
s.</p>
<p>The simple rule is:  Inheritance will not work when autoloading
non-methods.  The simple fix for old code is:  In any module that used
to depend on inheriting <code class="inline">AUTOLOAD</code>
 for non-methods from a base class
named <code class="inline"><span class="w">BaseClass</span></code>
, execute <code class="inline"><span class="i">*AUTOLOAD</span> = \<span class="i">&amp;BaseClass::AUTOLOAD</span></code>
 during
startup.</p>
<p>In code that currently says <code class="inline"><a class="l_k" href="functions/use.html">use</a> <span class="w">AutoLoader</span><span class="sc">;</span> <span class="i">@ISA</span> = <span class="q">qw(AutoLoader)</span><span class="sc">;</span></code>

you should remove AutoLoader from @ISA and change <code class="inline"><a class="l_k" href="functions/use.html">use</a> <span class="w">AutoLoader</span><span class="sc">;</span></code>
 to
<code class="inline"><a class="l_k" href="functions/use.html">use</a> <span class="w">AutoLoader</span> <span class="q">&#39;AUTOLOAD&#39;</span><span class="sc">;</span></code>
.</p>
<p>This feature was deprecated in Perl 5.004, and will be fatal in Perl 5.28.</p>
<a name="Use-of-code-points-over-0xFF-in-string-bitwise-operators"></a><h3>Use of code points over 0xFF in string bitwise operators</h3>
<p>The string bitwise operators, <code class="inline"><span class="i">&amp;</span></code>
, <code class="inline">|</code>, <code class="inline">^</code>, and <code class="inline">~</code>
, treat
their operands as strings of bytes. As such, values above 0xFF 
are nonsensical. Using such code points with these operators
was deprecated in Perl 5.24, and will be fatal in Perl 5.28.</p>
<a name="In-XS-code%2c-use-of-to_utf8_case()"></a><h3>In XS code, use of <code class="inline"><span class="i">to_utf8_case</span><span class="s">(</span><span class="s">)</span></code>
</h3>
<p>This function is being removed; instead convert to call
the appropriate one of:
<a href="perlapi.html#toFOLD_utf8_safe">toFOLD_utf8_safe </a>.
<a href="perlapi.html#toLOWER_utf8_safe">toLOWER_utf8_safe </a>,
<a href="perlapi.html#toTITLE_utf8_safe">toTITLE_utf8_safe </a>,
or
<a href="perlapi.html#toUPPER_utf8_safe">toUPPER_utf8_safe </a>.</p>
<a name="Perl-5.26"></a><h2>Perl 5.26</h2>
<a name="--libpods-in-Pod%3a%3aHtml"></a><h3><code class="inline">--<span class="w">libpods</span></code>
 in <code class="inline"><span class="w">Pod::Html</span></code>
</h3>
<p>Since Perl 5.18, the option <code class="inline">--<span class="w">libpods</span></code>
 has been deprecated, and
using this option did not do anything other than producing a warning.</p>
<p>The <code class="inline">--<span class="w">libpods</span></code>
 option is no longer recognized in Perl 5.26.</p>
<a name="The-utilities-c2ph-and-pstruct"></a><h3>The utilities <code class="inline"><span class="w">c2ph</span></code>
 and <code class="inline"><span class="w">pstruct</span></code>
</h3>
<p>These old, perl3-era utilities have been deprecated in favour of
<code class="inline"><span class="w">h2xs</span></code>
 for a long time. In Perl 5.26, they have been removed.</p>
<a name="Trapping-%24SIG-%7b__DIE__%7d-other-than-during-program-exit."></a><h3>Trapping <code class="inline"><span class="i">$SIG</span> {<span class="w">__DIE__</span>}</code>
 other than during program exit.</h3>
<p>The <code class="inline"><span class="i">$SIG</span>{<span class="w">__DIE__</span>}</code>
 hook is called even inside an <code class="inline"><a class="l_k" href="functions/eval.html">eval()</a></code>. It was
never intended to happen this way, but an implementation glitch made
this possible. This used to be deprecated, as it allowed strange action
at a distance like rewriting a pending exception in <code class="inline"><span class="i">$@</span></code>
. Plans to
rectify this have been scrapped, as users found that rewriting a
pending exception is actually a useful feature, and not a bug.</p>
<p>Perl never issued a deprecation warning for this; the deprecation
was by documentation policy only. But this deprecation has been 
lifted in Perl 5.26.</p>
<a name="Malformed-UTF-8-string-in-%22%25s%22"></a><h3>Malformed UTF-8 string in "%s"</h3>
<p>This message indicates a bug either in the Perl core or in XS
code. Such code was trying to find out if a character, allegedly
stored internally encoded as UTF-8, was of a given type, such as
being punctuation or a digit.  But the character was not encoded
in legal UTF-8.  The <code class="inline"><span class="i">%s</span></code>
 is replaced by a string that can be used
by knowledgeable people to determine what the type being checked
against was.</p>
<p>Passing malformed strings was deprecated in Perl 5.18, and
became fatal in Perl 5.26.</p>
<a name="Perl-5.24"></a><h2>Perl 5.24</h2>
<a name="Use-of-*glob%7bFILEHANDLE%7d"></a><h3>Use of <code class="inline"><span class="i">*glob</span>{<span class="w">FILEHANDLE</span>}</code>
</h3>
<p>The use of <code class="inline"><span class="i">*glob</span>{<span class="w">FILEHANDLE</span>}</code>
 was deprecated in Perl 5.8.
The intention was to use <code class="inline"><span class="i">*glob</span>{<span class="w">IO</span>}</code>
 instead, for which 
<code class="inline"><span class="i">*glob</span>{<span class="w">FILEHANDLE</span>}</code>
 is an alias.</p>
<p>However, this feature was undeprecated in Perl 5.24.</p>
<a name="Calling-POSIX%3a%3a%25s()-is-deprecated"></a><h3>Calling POSIX::%s() is deprecated</h3>
<p>The following functions in the <code class="inline"><span class="w">POSIX</span></code>
 module are no longer available:
<code class="inline"><span class="w">isalnum</span></code>
, <code class="inline"><span class="w">isalpha</span></code>
, <code class="inline"><span class="w">iscntrl</span></code>
, <code class="inline"><span class="w">isdigit</span></code>
, <code class="inline"><span class="w">isgraph</span></code>
, <code class="inline"><span class="w">islower</span></code>
,  
<code class="inline"><span class="w">isprint</span></code>
, <code class="inline"><span class="w">ispunct</span></code>
, <code class="inline"><span class="w">isspace</span></code>
, <code class="inline"><span class="w">isupper</span></code>
, and <code class="inline"><span class="w">isxdigit</span></code>
.  The 
functions are buggy and don't work on UTF-8 encoded strings.  See their
entries in <a href="POSIX.html">POSIX</a> for more information.</p>
<p>The functions were deprecated in Perl 5.20, and removed in Perl 5.24.</p>
<a name="Perl-5.16"></a><h2>Perl 5.16</h2>
<a name="Use-of-%25s-on-a-handle-without-*-is-deprecated"></a><h3>Use of %s on a handle without * is deprecated</h3>
<p>It used to be possible to use <code class="inline"><a class="l_k" href="functions/tie.html">tie</a></code>, <code class="inline"><a class="l_k" href="functions/tied.html">tied</a></code> or <code class="inline"><a class="l_k" href="functions/untie.html">untie</a></code> on a scalar
while the scalar holds a typeglob. This caused its filehandle to be
tied. It left no way to tie the scalar itself when it held a typeglob,
and no way to untie a scalar that had had a typeglob assigned to it.</p>
<p>This was deprecated in Perl 5.14, and the bug was fixed in Perl 5.16.</p>
<p>So now <code class="inline"><a class="l_k" href="functions/tie.html">tie</a> <span class="i">$scalar</span></code>
 will always tie the scalar, not the handle it holds.
To tie the handle, use <code class="inline"><a class="l_k" href="functions/tie.html">tie</a> <span class="i">*$scalar</span></code>
 (with an explicit asterisk).  The same
applies to <code class="inline"><a class="l_k" href="functions/tied.html">tied</a> <span class="i">*$scalar</span></code>
 and <code class="inline"><a class="l_k" href="functions/untie.html">untie</a> <span class="i">*$scalar</span></code>
.</p>
<a name="SEE-ALSO"></a><h1>SEE ALSO</h1>
<p><a href="warnings.html">warnings</a>, <a href="diagnostics.html">diagnostics</a>.</p>




  <div id="page_index" class="hud_container">
    <div id="page_index_header" class="hud_header">
      <div id="page_index_close" class="hud_close"><a href="#" onClick="pageIndex.hide();return false;"></a></div>
      <div id="page_index_title" class="hud_title"><span class="hud_span_top">Page index</span></div>
      <div id="page_index_topright" class="hud_topright"></div>
    </div>
    <div id="page_index_content" class="hud_content">
      <ul><li><a href="#NAME">NAME</a><li><a href="#DESCRIPTION">DESCRIPTION</a><ul><li><a href="#Perl-5.32">Perl 5.32</a><li><a href="#Perl-5.30">Perl 5.30</a><li><a href="#Perl-5.28">Perl 5.28</a><li><a href="#Perl-5.26">Perl 5.26</a><li><a href="#Perl-5.24">Perl 5.24</a><li><a href="#Perl-5.16">Perl 5.16</a></ul><li><a href="#SEE-ALSO">SEE ALSO</a></ul>
    </div>
    <div id="page_index_footer" class="hud_footer">
      <div id="page_index_bottomleft" class="hud_bottomleft"></div>
      <div id="page_index_bottom" class="hud_bottom"><span class="hud_span_bottom"></span></div>
      <div id="page_index_resize" class="hud_resize"></div>
    </div>
  </div>


	    &nbsp;
          </div>
          <div id="content_footer">
          </div>
        </div>
        <div class="clear"></div>
      </div>
      
    <div id="footer">
      <div id="footer_content">
        <div id="footer_strapline">
          perldoc.perl.org - Official documentation for the Perl programming language
        </div>
        <div id="footer_links">
          <div id="address">
            <p class="name">Contact details</p>
            <p class="address">
	      Site maintained by <a href="mailto:jj@jonallen.info">Jon Allen (JJ)</a><br>
	    </p>
            <p class="contact">
              Documentation maintained by the <a href="http://lists.cpan.org/showlist.cgi?name=perl5-porters">Perl 5 Porters</a>
            </p>
          </div>
          <ul class="f1">
            <li>Manual
              <ul class="f2">
                <li><a href="index-overview.html">Overview</a>
                <li><a href="index-tutorials.html">Tutorials</a>
                <li><a href="index-faq.html">FAQs</a>
                <li><a href="index-history.html">Changes</a>
              </ul>
            <li>Reference
              <ul class="f2">
                <li><a href="index-language.html">Language</a>
                <li><a href="index-functions.html">Functions</a>
                <li><a href="perlop.html">Operators</a>
                <li><a href="perlvar.html">Variables</a>
              </ul>
            <li>Modules
              <ul class="f2">
                <li><a href="index-modules-A.html">Modules</a>
                <li><a href="index-pragmas.html">Pragmas</a>
                <li><a href="index-utilities.html">Utilities</a>
              </ul>
            <li>Misc
              <ul class="f2">
                <li><a href="index-licence.html">License</a>
                <li><a href="index-internals.html">Internals</a>
                <li><a href="index-platforms.html">Platforms</a>
              </ul>          </ul>
          <div class="clear"></div>
        </div>
      </div>
      <div id="footer_end">
      </div>
    </div>
      
    </div>
      <script language="JavaScript" type="text/javascript" src="static/exploreperl.js"></script>
      <script language="JavaScript" src="static/combined-20100403.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
  perldoc.setPath(0);
  perldoc.pageName    = 'perldeprecation';
  perldoc.pageAddress = 'perldeprecation.html';
  perldoc.contentPage = 1;
  explorePerl.render();
  explorePerl.addEvents('explore_anchor');
</script>
    
  </body>
</html>