Debian Codegraph @

upstream/mageia-cauldron/man3pm/experimental.3pm

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man v6.0.2 (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 .\" Required to disable full justification in groff 1.23.0.
57 .if n .ds AD l
58 .\" ========================================================================
59 .\"
60 .IX Title "experimental 3pm"
61 .TH experimental 3pm 2025-06-24 "perl v5.42.0" "Perl Programmers Reference Guide"
62 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
63 .\" way too many mistakes in technical documents.
64 .if n .ad l
65 .nh
66 .SH NAME
67 experimental \- Experimental features made easy
68 .SH VERSION
69 .IX Header "VERSION"
70 version 0.035
71 .SH SYNOPSIS
72 .IX Header "SYNOPSIS"
73 .Vb 2
74 \& use experimental \*(Aqlexical_subs\*(Aq, \*(Aqsignatures\*(Aq;
75 \& my sub plus_one($value) { $value + 1 }
76 .Ve
77 .SH DESCRIPTION
78 .IX Header "DESCRIPTION"
79 This pragma provides an easy and convenient way to enable or disable
80 experimental features.
81 .PP
82 Every version of perl has some number of features present but considered
83 "experimental." For much of the life of Perl 5, this was only a designation
84 found in the documentation. Starting in Perl v5.10.0, and more aggressively in
85 v5.18.0, experimental features were placed behind pragmata used to enable the
86 feature and disable associated warnings.
87 .PP
88 The \f(CW\*(C`experimental\*(C'\fR pragma exists to combine the required incantations into a
89 single interface stable across releases of perl. For every experimental
90 feature, this should enable the feature and silence warnings for the enclosing
91 lexical scope:
92 .PP
93 .Vb 1
94 \& use experimental \*(Aqfeature\-name\*(Aq;
95 .Ve
96 .PP
97 To disable the feature and, if applicable, re\-enable any warnings, use:
98 .PP
99 .Vb 1
100 \& no experimental \*(Aqfeature\-name\*(Aq;
101 .Ve
102 .PP
103 The supported features, documented further below, are:
104 .IP \(bu 4
105 \&\f(CW\*(C`args_array_with_signatures\*(C'\fR \- allow \f(CW@_\fR to be used in signatured subs.
106 .Sp
107 This is supported on perl 5.20.0 and above, but is likely to be removed in the future.
108 .IP \(bu 4
109 \&\f(CW\*(C`array_base\*(C'\fR \- allow the use of \f(CW$[\fR to change the starting index of \f(CW@array\fR.
110 .Sp
111 This was removed in perl 5.30.0.
112 .IP \(bu 4
113 \&\f(CW\*(C`autoderef\*(C'\fR \- allow push, each, keys, and other built\-ins on references.
114 .Sp
115 This was added in perl 5.14.0 and removed in perl 5.24.0.
116 .IP \(bu 4
117 \&\f(CW\*(C`bitwise\*(C'\fR \- allow the new stringwise bit operators
118 .Sp
119 This was added in perl 5.22.0.
120 .IP \(bu 4
121 \&\f(CW\*(C`builtin\*(C'\fR \- allow the use of the functions in the builtin:: namespace
122 .Sp
123 This was added in perl 5.36.0
124 .IP \(bu 4
125 \&\f(CW\*(C`const_attr\*(C'\fR \- allow the :const attribute on subs
126 .Sp
127 This was added in perl 5.22.0.
128 .IP \(bu 4
129 \&\f(CW\*(C`declared_refs\*(C'\fR \- enables aliasing via assignment to references
130 .Sp
131 This was added in perl 5.26.0.
132 .IP \(bu 4
133 \&\f(CW\*(C`defer\*(C'\fR \- enables the use of defer blocks
134 .Sp
135 This was added in perl 5.36.0
136 .IP \(bu 4
137 \&\f(CW\*(C`extra_paired_delimiters\*(C'\fR \- enables the use of more paired string delimiters than the
138 traditional four, \f(CW\*(C`<\ \ >\*(C'\fR, \f(CW\*(C`(\ )\*(C'\fR, \f(CW\*(C`{\ }\*(C'\fR, and \f(CW\*(C`[\ ]\*(C'\fR.
139 .Sp
140 This was added in perl 5.36.
141 .IP \(bu 4
142 \&\f(CW\*(C`for_list\*(C'\fR \- allows iterating over multiple values at a time with \f(CW\*(C`for\*(C'\fR
143 .Sp
144 This was added in perl 5.36.0
145 .IP \(bu 4
146 \&\f(CW\*(C`isa\*(C'\fR \- allow the use of the \f(CW\*(C`isa\*(C'\fR infix operator
147 .Sp
148 This was added in perl 5.32.0.
149 .IP \(bu 4
150 \&\f(CW\*(C`lexical_topic\*(C'\fR \- allow the use of lexical \f(CW$_\fR via \f(CW\*(C`my $_\*(C'\fR.
151 .Sp
152 This was added in perl 5.10.0 and removed in perl 5.24.0.
153 .IP \(bu 4
154 \&\f(CW\*(C`lexical_subs\*(C'\fR \- allow the use of lexical subroutines.
155 .Sp
156 This was added in 5.18.0, and became non\-experimental (and always enabled) in 5.26.0.
157 .IP \(bu 4
158 \&\f(CW\*(C`postderef\*(C'\fR \- allow the use of postfix dereferencing expressions
159 .Sp
160 This was added in perl 5.20.0, and became non\-experimental (and always enabled) in 5.24.0.
161 .IP \(bu 4
162 \&\f(CW\*(C`postderef_qq\*(C'\fR \- allow the use of postfix dereferencing expressions inside interpolating strings
163 .Sp
164 This was added in perl 5.20.0, and became non\-experimental (and always enabled) in 5.24.0.
165 .IP \(bu 4
166 \&\f(CW\*(C`re_strict\*(C'\fR \- enables strict mode in regular expressions
167 .Sp
168 This was added in perl 5.22.0.
169 .IP \(bu 4
170 \&\f(CW\*(C`refaliasing\*(C'\fR \- allow aliasing via \f(CW\*(C`\e$x = \e$y\*(C'\fR
171 .Sp
172 This was added in perl 5.22.0.
173 .IP \(bu 4
174 \&\f(CW\*(C`regex_sets\*(C'\fR \- allow extended bracketed character classes in regexps
175 .Sp
176 This was added in perl 5.18.0, and became non\-experimental (and always
177 enabled) in 5.36.0.
178 .Sp
179 This is documented at
180 "Extended Bracketed Character Classes" in perlrecharclass.
181 .IP \(bu 4
182 \&\f(CW\*(C`signatures\*(C'\fR \- allow subroutine signatures (for named arguments)
183 .Sp
184 This was added in perl 5.20.0.
185 .IP \(bu 4
186 \&\f(CW\*(C`smartmatch\*(C'\fR \- allow the use of \f(CW\*(C`~~\*(C'\fR
187 .Sp
188 This was added in perl 5.10.0, but it should be noted there are significant
189 incompatibilities between 5.10.0 and 5.10.1.
190 .Sp
191 The feature was deprecated in perl 5.38.0, and undeprecated in 5.42.0.
192 .IP \(bu 4
193 \&\f(CW\*(C`switch\*(C'\fR \- allow the use of \f(CW\*(C`~~\*(C'\fR, given, and when
194 .Sp
195 This was added in perl 5.10.0.
196 .Sp
197 The feature was deprecated in perl 5.38.0, and undeprecated in
198 5.42.0.
199 .IP \(bu 4
200 \&\f(CW\*(C`try\*(C'\fR \- allow the use of \f(CW\*(C`try\*(C'\fR and \f(CW\*(C`catch\*(C'\fR
201 .Sp
202 This was added in perl 5.34.0
203 .IP \(bu 4
204 \&\f(CW\*(C`win32_perlio\*(C'\fR \- allows the use of the :win32 IO layer.
205 .Sp
206 This was added on perl 5.22.0.
207 .SS "Ordering matters"
208 .IX Subsection "Ordering matters"
209 Using this pragma to \*(Aqenable an experimental feature\*(Aq is another way of saying
210 that this pragma will disable the warnings which would result from using that
211 feature. Therefore, the order in which pragmas are applied is important. In
212 particular, you probably want to enable experimental features \fIafter\fR you
213 enable warnings:
214 .PP
215 .Vb 2
216 \& use warnings;
217 \& use experimental \*(Aqsmartmatch\*(Aq;
218 .Ve
219 .PP
220 You also need to take care with modules that enable warnings for you. A common
221 example being Moose. In this example, warnings for the \*(Aqsmartmatch\*(Aq feature are
222 first turned on by the warnings pragma, off by the experimental pragma and back
223 on again by the Moose module (fix is to switch the last two lines):
224 .PP
225 .Vb 3
226 \& use warnings;
227 \& use experimental \*(Aqsmartmatch\*(Aq;
228 \& use Moose;
229 .Ve
230 .SS Disclaimer
231 .IX Subsection "Disclaimer"
232 Because of the nature of the features it enables, forward compatibility can not
233 be guaranteed in any way.
234 .SH "SEE ALSO"
235 .IX Header "SEE ALSO"
236 perlexperiment contains more information about experimental features.
237 .SH AUTHOR
238 .IX Header "AUTHOR"
239 Leon Timmermans <[email protected]>
240 .SH "COPYRIGHT AND LICENSE"
241 .IX Header "COPYRIGHT AND LICENSE"
242 This software is copyright (c) 2013 by Leon Timmermans.
243 .PP
244 This is free software; you can redistribute it and/or modify it under
245 the same terms as the Perl 5 programming language system itself.