Commit | Line | Data |
---|---|---|
69bcf1d3 FC |
1 | #!/usr/bin/perl |
2 | # | |
3 | # Regenerate (overwriting only if changed): | |
4 | # | |
5 | # lib/feature.pm | |
f2c01b15 | 6 | # feature.h |
69bcf1d3 | 7 | # |
3489ea76 | 8 | # from information hardcoded into this script and from two #defines |
d73d634c | 9 | # in perl.h. |
69bcf1d3 FC |
10 | # |
11 | # This script is normally invoked from regen.pl. | |
12 | ||
13 | BEGIN { | |
69bcf1d3 | 14 | push @INC, './lib'; |
6ebc3431 YO |
15 | require './regen/regen_lib.pl'; |
16 | require './regen/HeaderParser.pm'; | |
69bcf1d3 | 17 | } |
69bcf1d3 | 18 | |
3b8e6999 N |
19 | use strict; |
20 | use warnings; | |
c452a42f FC |
21 | |
22 | ########################################################################### | |
23 | # Hand-editable data | |
24 | ||
c6b36e45 | 25 | # (feature name) => (internal name, used in %^H and macro names) |
69bcf1d3 | 26 | my %feature = ( |
ed628f52 PE |
27 | say => 'say', |
28 | state => 'state', | |
29 | switch => 'switch', | |
30 | bitwise => 'bitwise', | |
31 | evalbytes => 'evalbytes', | |
32 | current_sub => '__SUB__', | |
33 | refaliasing => 'refaliasing', | |
34 | postderef_qq => 'postderef_qq', | |
35 | unicode_eval => 'unieval', | |
36 | declared_refs => 'myref', | |
37 | unicode_strings => 'unicode', | |
38 | fc => 'fc', | |
39 | signatures => 'signatures', | |
40 | isa => 'isa', | |
41 | indirect => 'indirect', | |
42 | multidimensional => 'multidimensional', | |
43 | bareword_filehandles => 'bareword_filehandles', | |
44 | try => 'try', | |
45 | defer => 'defer', | |
9c9853e8 | 46 | extra_paired_delimiters => 'more_delims', |
ed628f52 | 47 | module_true => 'module_true', |
99b497aa | 48 | class => 'class', |
69bcf1d3 FC |
49 | ); |
50 | ||
40e4d872 FC |
51 | # NOTE: If a feature is ever enabled in a non-contiguous range of Perl |
52 | # versions, any code below that uses %BundleRanges will have to | |
53 | # be changed to account. | |
54 | ||
52fc5c56 | 55 | # 5.odd implies the next 5.even, but an explicit 5.even can override it. |
3b8e6999 N |
56 | |
57 | # features bundles | |
0f2beabb | 58 | use constant V5_9_5 => sort qw{say state switch indirect multidimensional bareword_filehandles}; |
3b8e6999 N |
59 | use constant V5_11 => sort ( +V5_9_5, qw{unicode_strings} ); |
60 | use constant V5_15 => sort ( +V5_11, qw{unicode_eval evalbytes current_sub fc} ); | |
61 | use constant V5_23 => sort ( +V5_15, qw{postderef_qq} ); | |
62 | use constant V5_27 => sort ( +V5_23, qw{bitwise} ); | |
cdba169f RS |
63 | |
64 | use constant V5_35 => sort grep {; $_ ne 'switch' | |
65 | && $_ ne 'indirect' | |
3d1a4f06 | 66 | && $_ ne 'multidimensional' } +V5_27, qw{isa signatures}; |
3b8e6999 | 67 | |
1102a6f0 | 68 | use constant V5_37 => sort grep {; $_ ne 'bareword_filehandles' } +V5_35, qw{module_true}; |
31c1155d | 69 | |
02cf5fb7 N |
70 | # |
71 | # when updating features please also update the Pod entry for L</"FEATURES CHEAT SHEET"> | |
72 | # | |
69bcf1d3 | 73 | my %feature_bundle = ( |
3b8e6999 | 74 | all => [ sort keys %feature ], |
0f2beabb | 75 | default => [ qw{indirect multidimensional bareword_filehandles} ], |
3b8e6999 N |
76 | # using 5.9.5 features bundle |
77 | "5.9.5" => [ +V5_9_5 ], | |
78 | "5.10" => [ +V5_9_5 ], | |
79 | # using 5.11 features bundle | |
80 | "5.11" => [ +V5_11 ], | |
81 | "5.13" => [ +V5_11 ], | |
82 | # using 5.15 features bundle | |
83 | "5.15" => [ +V5_15 ], | |
84 | "5.17" => [ +V5_15 ], | |
85 | "5.19" => [ +V5_15 ], | |
86 | "5.21" => [ +V5_15 ], | |
87 | # using 5.23 features bundle | |
88 | "5.23" => [ +V5_23 ], | |
89 | "5.25" => [ +V5_23 ], | |
90 | # using 5.27 features bundle | |
91 | "5.27" => [ +V5_27 ], | |
92 | "5.29" => [ +V5_27 ], | |
93 | "5.31" => [ +V5_27 ], | |
94 | "5.33" => [ +V5_27 ], | |
915e574d RS |
95 | # using 5.35 features bundle |
96 | "5.35" => [ +V5_35 ], | |
31c1155d DIM |
97 | # using 5.37 features bundle |
98 | "5.37" => [ +V5_37 ], | |
0d638322 | 99 | "5.39" => [ +V5_37 ], |
69bcf1d3 FC |
100 | ); |
101 | ||
db629560 | 102 | my @noops = qw( postderef lexical_subs ); |
c22e17d0 | 103 | my @removed = qw( array_base ); |
db629560 | 104 | |
c452a42f | 105 | |
69bcf1d3 | 106 | ########################################################################### |
c452a42f | 107 | # More data generated from the above |
69bcf1d3 | 108 | |
9f601cf3 TC |
109 | if (keys %feature > 32) { |
110 | die "cop_features only has room for 32 features"; | |
111 | } | |
112 | ||
113 | my %feature_bits; | |
114 | my $mask = 1; | |
115 | for my $feature (sort keys %feature) { | |
116 | $feature_bits{$feature} = $mask; | |
117 | $mask <<= 1; | |
118 | } | |
119 | ||
52fc5c56 FC |
120 | for (keys %feature_bundle) { |
121 | next unless /^5\.(\d*[13579])\z/; | |
122 | $feature_bundle{"5.".($1+1)} ||= $feature_bundle{$_}; | |
123 | } | |
124 | ||
f2c01b15 FC |
125 | my %UniqueBundles; # "say state switch" => 5.10 |
126 | my %Aliases; # 5.12 => 5.11 | |
127 | for( sort keys %feature_bundle ) { | |
128 | my $value = join(' ', sort @{$feature_bundle{$_}}); | |
129 | if (exists $UniqueBundles{$value}) { | |
130 | $Aliases{$_} = $UniqueBundles{$value}; | |
131 | } | |
132 | else { | |
133 | $UniqueBundles{$value} = $_; | |
134 | } | |
135 | } | |
40e4d872 FC |
136 | # start end |
137 | my %BundleRanges; # say => ['5.10', '5.15'] # unique bundles for values | |
138 | for my $bund ( | |
139 | sort { $a eq 'default' ? -1 : $b eq 'default' ? 1 : $a cmp $b } | |
140 | values %UniqueBundles | |
141 | ) { | |
03222170 | 142 | next if $bund =~ /[^\d.]/ and $bund ne 'default'; |
40e4d872 FC |
143 | for (@{$feature_bundle{$bund}}) { |
144 | if (@{$BundleRanges{$_} ||= []} == 2) { | |
145 | $BundleRanges{$_}[1] = $bund | |
146 | } | |
147 | else { | |
148 | push @{$BundleRanges{$_}}, $bund; | |
149 | } | |
150 | } | |
151 | } | |
69bcf1d3 | 152 | |
47222a2d | 153 | my $HintShift; |
ada44f8c | 154 | my $HintMask; |
3489ea76 | 155 | my $Uni8Bit; |
6ebc3431 | 156 | my $hp = HeaderParser->new()->read_file("perl.h"); |
47222a2d | 157 | |
6ebc3431 YO |
158 | foreach my $line_data (@{$hp->lines}) { |
159 | next unless $line_data->{type} eq "content" | |
160 | and $line_data->{sub_type} eq "#define"; | |
161 | my $line = $line_data->{line}; | |
162 | next unless $line=~/^\s*#\s*define\s+(HINT_FEATURE_MASK|HINT_UNI_8_BIT)/; | |
3489ea76 | 163 | my $is_u8b = $1 =~ 8; |
6ebc3431 | 164 | $line=~/(0x[A-Fa-f0-9]+)/ or die "No hex number in:\n\n$line\n "; |
3489ea76 FC |
165 | if ($is_u8b) { |
166 | $Uni8Bit = $1; | |
167 | } | |
168 | else { | |
ada44f8c | 169 | my $hex = $HintMask = $1; |
47222a2d FC |
170 | my $bits = sprintf "%b", oct $1; |
171 | $bits =~ /^0*1+(0*)\z/ | |
6ebc3431 | 172 | or die "Non-contiguous bits in $bits (binary for $hex):\n\n$line\n "; |
47222a2d FC |
173 | $HintShift = length $1; |
174 | my $bits_needed = | |
175 | length sprintf "%b", scalar keys %UniqueBundles; | |
176 | $bits =~ /1{$bits_needed}/ | |
177 | or die "Not enough bits (need $bits_needed)" | |
6ebc3431 | 178 | . " in $bits (binary for $hex):\n\n$line\n "; |
47222a2d | 179 | } |
3489ea76 | 180 | if ($Uni8Bit && $HintMask) { last } |
47222a2d | 181 | } |
3489ea76 FC |
182 | die "No HINT_FEATURE_MASK defined in perl.h" unless $HintMask; |
183 | die "No HINT_UNI_8_BIT defined in perl.h" unless $Uni8Bit; | |
184 | ||
ada44f8c FC |
185 | my @HintedBundles = |
186 | ('default', grep !/[^\d.]/, sort values %UniqueBundles); | |
187 | ||
47222a2d | 188 | |
f2c01b15 | 189 | ########################################################################### |
c452a42f | 190 | # Open files to be generated |
f2c01b15 FC |
191 | |
192 | my ($pm, $h) = map { | |
69bcf1d3 | 193 | open_new($_, '>', { by => 'regen/feature.pl' }); |
f2c01b15 | 194 | } 'lib/feature.pm', 'feature.h'; |
69bcf1d3 FC |
195 | |
196 | ||
c452a42f FC |
197 | ########################################################################### |
198 | # Generate lib/feature.pm | |
199 | ||
69bcf1d3 FC |
200 | while (<DATA>) { |
201 | last if /^FEATURES$/ ; | |
202 | print $pm $_ ; | |
203 | } | |
204 | ||
205 | sub longest { | |
206 | my $long; | |
207 | for(@_) { | |
208 | if (!defined $long or length $long < length) { | |
209 | $long = $_; | |
210 | } | |
211 | } | |
212 | $long; | |
213 | } | |
214 | ||
0bb01b05 | 215 | print $pm "our %feature = (\n"; |
69bcf1d3 | 216 | my $width = length longest keys %feature; |
ebd25686 | 217 | for(sort { length $a <=> length $b || $a cmp $b } keys %feature) { |
67bdaa9e FC |
218 | print $pm " $_" . " "x($width-length) |
219 | . " => 'feature_$feature{$_}',\n"; | |
69bcf1d3 FC |
220 | } |
221 | print $pm ");\n\n"; | |
222 | ||
69bcf1d3 | 223 | print $pm "our %feature_bundle = (\n"; |
9f601cf3 | 224 | my $bund_width = length longest values %UniqueBundles; |
88da30d7 FC |
225 | for( sort { $UniqueBundles{$a} cmp $UniqueBundles{$b} } |
226 | keys %UniqueBundles ) { | |
227 | my $bund = $UniqueBundles{$_}; | |
9f601cf3 | 228 | print $pm qq' "$bund"' . " "x($bund_width-length $bund) |
88da30d7 | 229 | . qq' => [qw($_)],\n'; |
69bcf1d3 FC |
230 | } |
231 | print $pm ");\n\n"; | |
232 | ||
88da30d7 FC |
233 | for (sort keys %Aliases) { |
234 | print $pm | |
235 | qq'\$feature_bundle{"$_"} = \$feature_bundle{"$Aliases{$_}"};\n'; | |
236 | }; | |
69bcf1d3 | 237 | |
db629560 FC |
238 | print $pm "my \%noops = (\n"; |
239 | print $pm " $_ => 1,\n", for @noops; | |
240 | print $pm ");\n"; | |
241 | ||
c22e17d0 DIM |
242 | print $pm "my \%removed = (\n"; |
243 | print $pm " $_ => 1,\n", for @removed; | |
244 | print $pm ");\n"; | |
245 | ||
ada44f8c FC |
246 | print $pm <<EOPM; |
247 | ||
0bb01b05 FC |
248 | our \$hint_shift = $HintShift; |
249 | our \$hint_mask = $HintMask; | |
250 | our \@hint_bundles = qw( @HintedBundles ); | |
3489ea76 FC |
251 | |
252 | # This gets set (for now) in \$^H as well as in %^H, | |
253 | # for runtime speed of the uc/lc/ucfirst/lcfirst functions. | |
254 | # See HINT_UNI_8_BIT in perl.h. | |
255 | our \$hint_uni8bit = $Uni8Bit; | |
ada44f8c FC |
256 | EOPM |
257 | ||
69bcf1d3 FC |
258 | |
259 | while (<DATA>) { | |
2b3fe414 FC |
260 | last if /^PODTURES$/ ; |
261 | print $pm $_ ; | |
262 | } | |
263 | ||
264 | select +(select($pm), $~ = 'PODTURES')[0]; | |
265 | format PODTURES = | |
266 | ^<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~ | |
267 | $::bundle, $::feature | |
268 | . | |
269 | ||
270 | for ('default', sort grep /\.\d[02468]/, keys %feature_bundle) { | |
271 | $::bundle = ":$_"; | |
272 | $::feature = join ' ', @{$feature_bundle{$_}}; | |
273 | write $pm; | |
274 | print $pm "\n"; | |
275 | } | |
276 | ||
277 | while (<DATA>) { | |
69bcf1d3 FC |
278 | print $pm $_ ; |
279 | } | |
280 | ||
281 | read_only_bottom_close_and_rename($pm); | |
282 | ||
c452a42f FC |
283 | |
284 | ########################################################################### | |
285 | # Generate feature.h | |
286 | ||
f2c01b15 FC |
287 | print $h <<EOH; |
288 | ||
3dd7db29 JK |
289 | #ifndef PERL_FEATURE_H_ |
290 | #define PERL_FEATURE_H_ | |
291 | ||
f2c01b15 FC |
292 | #if defined(PERL_CORE) || defined (PERL_EXT) |
293 | ||
294 | #define HINT_FEATURE_SHIFT $HintShift | |
295 | ||
f2c01b15 FC |
296 | EOH |
297 | ||
9f601cf3 TC |
298 | for (sort keys %feature_bits) { |
299 | printf $h "#define FEATURE_%s_BIT%*s %#06x\n", uc($feature{$_}), | |
300 | $width-length($feature{$_}), "", $feature_bits{$_}; | |
301 | } | |
302 | print $h "\n"; | |
303 | ||
f2c01b15 | 304 | my $count; |
016d11cb FC |
305 | for (@HintedBundles) { |
306 | (my $key = uc) =~ y/.//d; | |
307 | print $h "#define FEATURE_BUNDLE_$key ", $count++, "\n"; | |
f2c01b15 FC |
308 | } |
309 | ||
7d058bc9 | 310 | print $h <<'EOH'; |
2b9e0ab7 | 311 | #define FEATURE_BUNDLE_CUSTOM (HINT_FEATURE_MASK >> HINT_FEATURE_SHIFT) |
f2c01b15 | 312 | |
7b038bdf YO |
313 | /* this is preserved for testing and asserts */ |
314 | #define OLD_CURRENT_HINTS \ | |
d1fd0100 | 315 | (PL_curcop == &PL_compiling ? PL_hints : PL_curcop->cop_hints) |
7b038bdf YO |
316 | /* this is the same thing, but simpler (no if) as PL_hints expands |
317 | to PL_compiling.cop_hints */ | |
318 | #define CURRENT_HINTS \ | |
319 | PL_curcop->cop_hints | |
035b6821 FC |
320 | #define CURRENT_FEATURE_BUNDLE \ |
321 | ((CURRENT_HINTS & HINT_FEATURE_MASK) >> HINT_FEATURE_SHIFT) | |
d1fd0100 | 322 | |
9f601cf3 TC |
323 | #define FEATURE_IS_ENABLED_MASK(mask) \ |
324 | ((CURRENT_HINTS & HINT_LOCALIZE_HH) \ | |
325 | ? (PL_curcop->cop_features & (mask)) : FALSE) | |
326 | ||
7d058bc9 | 327 | /* The longest string we pass in. */ |
03222170 FC |
328 | EOH |
329 | ||
1b6e8741 FC |
330 | my $longest_internal_feature_name = longest values %feature; |
331 | print $h <<EOL; | |
332 | #define MAX_FEATURE_LEN (sizeof("$longest_internal_feature_name")-1) | |
333 | ||
334 | EOL | |
335 | ||
03222170 | 336 | for ( |
ebd25686 | 337 | sort { length $a <=> length $b || $a cmp $b } keys %feature |
03222170 FC |
338 | ) { |
339 | my($first,$last) = | |
340 | map { (my $__ = uc) =~ y/.//d; $__ } @{$BundleRanges{$_}}; | |
3fff3427 | 341 | my $name = $feature{$_}; |
03222170 | 342 | my $NAME = uc $name; |
f298f061 | 343 | if ($last && $first eq 'DEFAULT') { # '>= DEFAULT' warns |
beda0318 | 344 | print $h <<EOI; |
23fa16fc | 345 | #define FEATURE_${NAME}_IS_ENABLED \\ |
beda0318 FC |
346 | ( \\ |
347 | CURRENT_FEATURE_BUNDLE <= FEATURE_BUNDLE_$last \\ | |
348 | || (CURRENT_FEATURE_BUNDLE == FEATURE_BUNDLE_CUSTOM && \\ | |
23fa16fc | 349 | FEATURE_IS_ENABLED_MASK(FEATURE_${NAME}_BIT)) \\ |
beda0318 FC |
350 | ) |
351 | ||
352 | EOI | |
353 | } | |
354 | elsif ($last) { | |
03222170 | 355 | print $h <<EOH3; |
23fa16fc | 356 | #define FEATURE_${NAME}_IS_ENABLED \\ |
03222170 FC |
357 | ( \\ |
358 | (CURRENT_FEATURE_BUNDLE >= FEATURE_BUNDLE_$first && \\ | |
359 | CURRENT_FEATURE_BUNDLE <= FEATURE_BUNDLE_$last) \\ | |
360 | || (CURRENT_FEATURE_BUNDLE == FEATURE_BUNDLE_CUSTOM && \\ | |
23fa16fc | 361 | FEATURE_IS_ENABLED_MASK(FEATURE_${NAME}_BIT)) \\ |
03222170 FC |
362 | ) |
363 | ||
364 | EOH3 | |
365 | } | |
ebd25686 | 366 | elsif ($first) { |
03222170 | 367 | print $h <<EOH4; |
23fa16fc | 368 | #define FEATURE_${NAME}_IS_ENABLED \\ |
03222170 FC |
369 | ( \\ |
370 | CURRENT_FEATURE_BUNDLE == FEATURE_BUNDLE_$first \\ | |
371 | || (CURRENT_FEATURE_BUNDLE == FEATURE_BUNDLE_CUSTOM && \\ | |
23fa16fc | 372 | FEATURE_IS_ENABLED_MASK(FEATURE_${NAME}_BIT)) \\ |
03222170 FC |
373 | ) |
374 | ||
375 | EOH4 | |
376 | } | |
ebd25686 FC |
377 | else { |
378 | print $h <<EOH5; | |
23fa16fc | 379 | #define FEATURE_${NAME}_IS_ENABLED \\ |
ebd25686 FC |
380 | ( \\ |
381 | CURRENT_FEATURE_BUNDLE == FEATURE_BUNDLE_CUSTOM && \\ | |
23fa16fc | 382 | FEATURE_IS_ENABLED_MASK(FEATURE_${NAME}_BIT) \\ |
ebd25686 FC |
383 | ) |
384 | ||
385 | EOH5 | |
386 | } | |
03222170 FC |
387 | } |
388 | ||
389 | print $h <<EOH; | |
390 | ||
9f601cf3 TC |
391 | #define SAVEFEATUREBITS() SAVEI32(PL_compiling.cop_features) |
392 | ||
393 | #define CLEARFEATUREBITS() (PL_compiling.cop_features = 0) | |
394 | ||
b5cbb3ce | 395 | #define FETCHFEATUREBITSHH(hh) S_fetch_feature_bits_hh(aTHX_ (hh)) |
9f601cf3 | 396 | |
f2c01b15 | 397 | #endif /* PERL_CORE or PERL_EXT */ |
4160ddbd FC |
398 | |
399 | #ifdef PERL_IN_OP_C | |
400 | PERL_STATIC_INLINE void | |
401 | S_enable_feature_bundle(pTHX_ SV *ver) | |
402 | { | |
403 | SV *comp_ver = sv_newmortal(); | |
404 | PL_hints = (PL_hints &~ HINT_FEATURE_MASK) | |
405 | | ( | |
f2c01b15 FC |
406 | EOH |
407 | ||
4160ddbd FC |
408 | for (reverse @HintedBundles[1..$#HintedBundles]) { # skip default |
409 | my $numver = $_; | |
410 | if ($numver eq '5.10') { $numver = '5.009005' } # special case | |
411 | else { $numver =~ s/\./.0/ } # 5.11 => 5.011 | |
412 | (my $macrover = $_) =~ y/.//d; | |
413 | print $h <<" EOK"; | |
414 | (sv_setnv(comp_ver, $numver), | |
415 | vcmp(ver, upg_version(comp_ver, FALSE)) >= 0) | |
416 | ? FEATURE_BUNDLE_$macrover : | |
417 | EOK | |
418 | } | |
419 | ||
420 | print $h <<EOJ; | |
421 | FEATURE_BUNDLE_DEFAULT | |
422 | ) << HINT_FEATURE_SHIFT; | |
6389c777 FC |
423 | /* special case */ |
424 | assert(PL_curcop == &PL_compiling); | |
425 | if (FEATURE_UNICODE_IS_ENABLED) PL_hints |= HINT_UNI_8_BIT; | |
426 | else PL_hints &= ~HINT_UNI_8_BIT; | |
4160ddbd FC |
427 | } |
428 | #endif /* PERL_IN_OP_C */ | |
3dd7db29 | 429 | |
b5cbb3ce | 430 | #if defined(PERL_IN_MG_C) || defined(PERL_IN_PP_CTL_C) |
b34c1a7e TC |
431 | |
432 | #define magic_sethint_feature(keysv, keypv, keylen, valsv, valbool) \\ | |
433 | S_magic_sethint_feature(aTHX_ (keysv), (keypv), (keylen), (valsv), (valbool)) | |
434 | PERL_STATIC_INLINE void | |
435 | S_magic_sethint_feature(pTHX_ SV *keysv, const char *keypv, STRLEN keylen, | |
436 | SV *valsv, bool valbool) { | |
437 | if (keysv) | |
438 | keypv = SvPV_const(keysv, keylen); | |
439 | ||
440 | if (memBEGINs(keypv, keylen, "feature_")) { | |
441 | const char *subf = keypv + (sizeof("feature_")-1); | |
442 | U32 mask = 0; | |
443 | switch (*subf) { | |
444 | EOJ | |
445 | ||
446 | my %pref; | |
447 | for my $key (sort values %feature) { | |
448 | push @{$pref{substr($key, 0, 1)}}, $key; | |
449 | } | |
450 | ||
451 | for my $pref (sort keys %pref) { | |
452 | print $h <<EOS; | |
453 | case '$pref': | |
454 | EOS | |
455 | my $first = 1; | |
456 | for my $subkey (@{$pref{$pref}}) { | |
457 | my $rest = substr($subkey, 1); | |
458 | my $if = $first ? "if" : "else if"; | |
459 | print $h <<EOJ; | |
460 | $if (keylen == sizeof("feature_$subkey")-1 | |
461 | && memcmp(subf+1, "$rest", keylen - sizeof("feature_")) == 0) { | |
462 | mask = FEATURE_\U${subkey}\E_BIT; | |
463 | break; | |
464 | } | |
465 | EOJ | |
466 | ||
467 | $first = 0; | |
468 | } | |
469 | print $h <<EOS; | |
470 | return; | |
471 | ||
472 | EOS | |
473 | } | |
474 | ||
475 | print $h <<EOJ; | |
476 | default: | |
477 | return; | |
478 | } | |
479 | if (valsv ? SvTRUE(valsv) : valbool) | |
480 | PL_compiling.cop_features |= mask; | |
481 | else | |
482 | PL_compiling.cop_features &= ~mask; | |
483 | } | |
484 | } | |
485 | #endif /* PERL_IN_MG_C */ | |
486 | ||
b5cbb3ce TC |
487 | /* subject to change */ |
488 | struct perl_feature_bit { | |
489 | const char *name; | |
490 | STRLEN namelen; | |
491 | U32 mask; | |
492 | }; | |
493 | ||
494 | #ifdef PERL_IN_PP_CTL_C | |
495 | ||
496 | static const struct perl_feature_bit | |
497 | PL_feature_bits[] = { | |
498 | EOJ | |
499 | for my $key (sort keys %feature) { | |
500 | my $val = $feature{$key}; | |
501 | print $h <<EOJ; | |
502 | { | |
503 | /* feature $key */ | |
504 | "feature_$val", | |
505 | STRLENs("feature_$val"), | |
506 | FEATURE_\U$val\E_BIT | |
507 | }, | |
508 | EOJ | |
509 | } | |
510 | ||
511 | print $h <<EOJ; | |
512 | { NULL, 0, 0U } | |
513 | }; | |
514 | ||
515 | PERL_STATIC_INLINE void | |
516 | S_fetch_feature_bits_hh(pTHX_ HV *hh) { | |
517 | PL_compiling.cop_features = 0; | |
518 | ||
519 | const struct perl_feature_bit *fb = PL_feature_bits; | |
520 | while (fb->name) { | |
521 | SV **svp = hv_fetch(hh, fb->name, (I32)fb->namelen, 0); | |
522 | if (svp && SvTRUE(*svp)) | |
523 | PL_compiling.cop_features |= fb->mask; | |
524 | ++fb; | |
525 | } | |
526 | } | |
527 | ||
528 | #endif | |
529 | ||
3dd7db29 | 530 | #endif /* PERL_FEATURE_H_ */ |
4160ddbd FC |
531 | EOJ |
532 | ||
f2c01b15 FC |
533 | read_only_bottom_close_and_rename($h); |
534 | ||
c452a42f FC |
535 | |
536 | ########################################################################### | |
537 | # Template for feature.pm | |
538 | ||
69bcf1d3 FC |
539 | __END__ |
540 | package feature; | |
4035348a | 541 | our $VERSION = '1.86'; |
69bcf1d3 FC |
542 | |
543 | FEATURES | |
544 | ||
69bcf1d3 FC |
545 | # TODO: |
546 | # - think about versioned features (use feature switch => 2) | |
547 | ||
9c9853e8 KW |
548 | =encoding utf8 |
549 | ||
69bcf1d3 FC |
550 | =head1 NAME |
551 | ||
552 | feature - Perl pragma to enable new features | |
553 | ||
554 | =head1 SYNOPSIS | |
555 | ||
d15aa6ae RS |
556 | use feature qw(fc say); |
557 | ||
558 | # Without the "use feature" above, this code would not be able to find | |
559 | # the built-ins "say" or "fc": | |
560 | say "The case-folded version of $x is: " . fc $x; | |
561 | ||
562 | ||
02cf5fb7 N |
563 | # set features to match the :5.36 bundle, which may turn off or on |
564 | # multiple features (see "FEATURE BUNDLES" below) | |
565 | use feature ':5.36'; | |
69bcf1d3 | 566 | |
69bcf1d3 | 567 | |
02cf5fb7 N |
568 | # implicitly loads :5.36 feature bundle |
569 | use v5.36; | |
69bcf1d3 FC |
570 | |
571 | =head1 DESCRIPTION | |
572 | ||
573 | It is usually impossible to add new syntax to Perl without breaking | |
574 | some existing programs. This pragma provides a way to minimize that | |
575 | risk. New syntactic constructs, or new semantic meanings to older | |
576 | constructs, can be enabled by C<use feature 'foo'>, and will be parsed | |
577 | only when the appropriate feature pragma is in scope. (Nevertheless, the | |
578 | C<CORE::> prefix provides access to all Perl keywords, regardless of this | |
579 | pragma.) | |
580 | ||
581 | =head2 Lexical effect | |
582 | ||
583 | Like other pragmas (C<use strict>, for example), features have a lexical | |
301381dc | 584 | effect. C<use feature qw(foo)> will only make the feature "foo" available |
69bcf1d3 FC |
585 | from that point to the end of the enclosing block. |
586 | ||
587 | { | |
588 | use feature 'say'; | |
589 | say "say is available here"; | |
590 | } | |
591 | print "But not here.\n"; | |
592 | ||
593 | =head2 C<no feature> | |
594 | ||
595 | Features can also be turned off by using C<no feature "foo">. This too | |
596 | has lexical effect. | |
597 | ||
598 | use feature 'say'; | |
599 | say "say is available here"; | |
600 | { | |
601 | no feature 'say'; | |
602 | print "But not here.\n"; | |
603 | } | |
604 | say "Yet it is here."; | |
605 | ||
39ec54a5 RS |
606 | C<no feature> with no features specified will reset to the default group. To |
607 | disable I<all> features (an unusual request!) use C<no feature ':all'>. | |
69bcf1d3 FC |
608 | |
609 | =head1 AVAILABLE FEATURES | |
610 | ||
8333937f | 611 | Read L</"FEATURE BUNDLES"> for the feature cheat sheet summary. |
02cf5fb7 | 612 | |
69bcf1d3 FC |
613 | =head2 The 'say' feature |
614 | ||
5d6cc146 | 615 | C<use feature 'say'> tells the compiler to enable the Raku-inspired |
69bcf1d3 FC |
616 | C<say> function. |
617 | ||
618 | See L<perlfunc/say> for details. | |
619 | ||
620 | This feature is available starting with Perl 5.10. | |
621 | ||
622 | =head2 The 'state' feature | |
623 | ||
624 | C<use feature 'state'> tells the compiler to enable C<state> | |
625 | variables. | |
626 | ||
627 | See L<perlsub/"Persistent Private Variables"> for details. | |
628 | ||
629 | This feature is available starting with Perl 5.10. | |
630 | ||
631 | =head2 The 'switch' feature | |
632 | ||
d23c9e49 RS |
633 | B<WARNING>: This feature is still experimental and the implementation may |
634 | change or be removed in future versions of Perl. For this reason, Perl will | |
635 | warn when you use the feature, unless you have explicitly disabled the warning: | |
7caca87c DB |
636 | |
637 | no warnings "experimental::smartmatch"; | |
638 | ||
5d6cc146 | 639 | C<use feature 'switch'> tells the compiler to enable the Raku |
69bcf1d3 FC |
640 | given/when construct. |
641 | ||
48238296 | 642 | See L<perlsyn/"Switch Statements"> for details. |
69bcf1d3 FC |
643 | |
644 | This feature is available starting with Perl 5.10. | |
ac8ba642 PBB |
645 | It is deprecated starting with Perl 5.38, and using |
646 | C<given>, C<when> or smartmatch will throw a warning. | |
647 | It will be removed in Perl 5.42. | |
69bcf1d3 FC |
648 | |
649 | =head2 The 'unicode_strings' feature | |
650 | ||
850b7ec9 | 651 | C<use feature 'unicode_strings'> tells the compiler to use Unicode rules |
69bcf1d3 FC |
652 | in all string operations executed within its scope (unless they are also |
653 | within the scope of either C<use locale> or C<use bytes>). The same applies | |
654 | to all regular expressions compiled within the scope, even if executed outside | |
2269d15c KW |
655 | it. It does not change the internal representation of strings, but only how |
656 | they are interpreted. | |
69bcf1d3 FC |
657 | |
658 | C<no feature 'unicode_strings'> tells the compiler to use the traditional | |
850b7ec9 | 659 | Perl rules wherein the native character set rules is used unless it is |
69bcf1d3 FC |
660 | clear to Perl that Unicode is desired. This can lead to some surprises |
661 | when the behavior suddenly changes. (See | |
662 | L<perlunicode/The "Unicode Bug"> for details.) For this reason, if you are | |
663 | potentially using Unicode in your program, the | |
664 | C<use feature 'unicode_strings'> subpragma is B<strongly> recommended. | |
665 | ||
2e2b2571 | 666 | This feature is available starting with Perl 5.12; was almost fully |
d6c970c7 | 667 | implemented in Perl 5.14; and extended in Perl 5.16 to cover C<quotemeta>; |
20ae58f7 AC |
668 | was extended further in Perl 5.26 to cover L<the range |
669 | operator|perlop/Range Operators>; and was extended again in Perl 5.28 to | |
670 | cover L<special-cased whitespace splitting|perlfunc/split>. | |
69bcf1d3 FC |
671 | |
672 | =head2 The 'unicode_eval' and 'evalbytes' features | |
673 | ||
9891e9b7 KW |
674 | Together, these two features are intended to replace the legacy string |
675 | C<eval> function, which behaves problematically in some instances. They are | |
676 | available starting with Perl 5.16, and are enabled by default by a | |
677 | S<C<use 5.16>> or higher declaration. | |
678 | ||
679 | C<unicode_eval> changes the behavior of plain string C<eval> to work more | |
680 | consistently, especially in the Unicode world. Certain (mis)behaviors | |
681 | couldn't be changed without breaking some things that had come to rely on | |
682 | them, so the feature can be enabled and disabled. Details are at | |
683 | L<perlfunc/Under the "unicode_eval" feature>. | |
684 | ||
e6f2f64a FG |
685 | C<evalbytes> is like string C<eval>, but it treats its argument as a byte |
686 | string. Details are at L<perlfunc/evalbytes EXPR>. Without a | |
9891e9b7 KW |
687 | S<C<use feature 'evalbytes'>> nor a S<C<use v5.16>> (or higher) declaration in |
688 | the current scope, you can still access it by instead writing | |
689 | C<CORE::evalbytes>. | |
69bcf1d3 FC |
690 | |
691 | =head2 The 'current_sub' feature | |
692 | ||
693 | This provides the C<__SUB__> token that returns a reference to the current | |
694 | subroutine or C<undef> outside of a subroutine. | |
695 | ||
696 | This feature is available starting with Perl 5.16. | |
697 | ||
698 | =head2 The 'array_base' feature | |
699 | ||
c22e17d0 DIM |
700 | This feature supported the legacy C<$[> variable. See L<perlvar/$[>. |
701 | It was on by default but disabled under C<use v5.16> (see | |
702 | L</IMPLICIT LOADING>, below) and unavailable since perl 5.30. | |
69bcf1d3 FC |
703 | |
704 | This feature is available under this name starting with Perl 5.16. In | |
705 | previous versions, it was simply on all the time, and this pragma knew | |
706 | nothing about it. | |
707 | ||
2a4315f8 BF |
708 | =head2 The 'fc' feature |
709 | ||
710 | C<use feature 'fc'> tells the compiler to enable the C<fc> function, | |
711 | which implements Unicode casefolding. | |
712 | ||
713 | See L<perlfunc/fc> for details. | |
714 | ||
715 | This feature is available from Perl 5.16 onwards. | |
716 | ||
ca40957e FC |
717 | =head2 The 'lexical_subs' feature |
718 | ||
8f7d85af FC |
719 | In Perl versions prior to 5.26, this feature enabled |
720 | declaration of subroutines via C<my sub foo>, C<state sub foo> | |
721 | and C<our sub foo> syntax. See L<perlsub/Lexical Subroutines> for details. | |
ca40957e | 722 | |
8f7d85af FC |
723 | This feature is available from Perl 5.18 onwards. From Perl 5.18 to 5.24, |
724 | it was classed as experimental, and Perl emitted a warning for its | |
725 | usage, except when explicitly disabled: | |
ca40957e | 726 | |
8f7d85af | 727 | no warnings "experimental::lexical_subs"; |
ca40957e | 728 | |
8f7d85af FC |
729 | As of Perl 5.26, use of this feature no longer triggers a warning, though |
730 | the C<experimental::lexical_subs> warning category still exists (for | |
731 | compatibility with code that disables it). In addition, this syntax is | |
732 | not only no longer experimental, but it is enabled for all Perl code, | |
733 | regardless of what feature declarations are in scope. | |
ca40957e | 734 | |
f86d720e RS |
735 | =head2 The 'postderef' and 'postderef_qq' features |
736 | ||
1c2511e0 | 737 | The 'postderef_qq' feature extends the applicability of L<postfix |
365f3e0f ZM |
738 | dereference syntax|perlref/Postfix Dereference Syntax> so that |
739 | postfix array dereference, postfix scalar dereference, and | |
740 | postfix array highest index access are available in double-quotish interpolations. | |
741 | For example, it makes the following two statements equivalent: | |
f86d720e | 742 | |
1c2511e0 AC |
743 | my $s = "[@{ $h->{a} }]"; |
744 | my $s = "[$h->{a}->@*]"; | |
f86d720e | 745 | |
1c2511e0 AC |
746 | This feature is available from Perl 5.20 onwards. In Perl 5.20 and 5.22, it |
747 | was classed as experimental, and Perl emitted a warning for its | |
2ad792cd AC |
748 | usage, except when explicitly disabled: |
749 | ||
750 | no warnings "experimental::postderef"; | |
751 | ||
1c2511e0 | 752 | As of Perl 5.24, use of this feature no longer triggers a warning, though |
2ad792cd AC |
753 | the C<experimental::postderef> warning category still exists (for |
754 | compatibility with code that disables it). | |
f86d720e | 755 | |
1c2511e0 AC |
756 | The 'postderef' feature was used in Perl 5.20 and Perl 5.22 to enable |
757 | postfix dereference syntax outside double-quotish interpolations. In those | |
758 | versions, using it triggered the C<experimental::postderef> warning in the | |
759 | same way as the 'postderef_qq' feature did. As of Perl 5.24, this syntax is | |
760 | not only no longer experimental, but it is enabled for all Perl code, | |
761 | regardless of what feature declarations are in scope. | |
762 | ||
30d9c59b Z |
763 | =head2 The 'signatures' feature |
764 | ||
3d1a4f06 | 765 | This enables syntax for declaring subroutine arguments as lexical variables. |
765cd546 | 766 | For example, for this subroutine: |
30d9c59b Z |
767 | |
768 | sub foo ($left, $right) { | |
3d1a4f06 | 769 | return $left + $right; |
30d9c59b Z |
770 | } |
771 | ||
3d1a4f06 PE |
772 | Calling C<foo(3, 7)> will assign C<3> into C<$left> and C<7> into C<$right>. |
773 | ||
30d9c59b Z |
774 | See L<perlsub/Signatures> for details. |
775 | ||
088588be PE |
776 | This feature is available from Perl 5.20 onwards. From Perl 5.20 to 5.34, |
777 | it was classed as experimental, and Perl emitted a warning for its usage, | |
778 | except when explicitly disabled: | |
779 | ||
780 | no warnings "experimental::signatures"; | |
781 | ||
782 | As of Perl 5.36, use of this feature no longer triggers a warning, though the | |
783 | C<experimental::signatures> warning category still exists (for compatibility | |
3d1a4f06 PE |
784 | with code that disables it). This feature is now considered stable, and is |
785 | enabled automatically by C<use v5.36> (or higher). | |
30d9c59b | 786 | |
baabe3fb | 787 | =head2 The 'refaliasing' feature |
82848c10 FC |
788 | |
789 | B<WARNING>: This feature is still experimental and the implementation may | |
d23c9e49 RS |
790 | change or be removed in future versions of Perl. For this reason, Perl will |
791 | warn when you use the feature, unless you have explicitly disabled the warning: | |
82848c10 | 792 | |
baabe3fb | 793 | no warnings "experimental::refaliasing"; |
82848c10 FC |
794 | |
795 | This enables aliasing via assignment to references: | |
796 | ||
797 | \$a = \$b; # $a and $b now point to the same scalar | |
798 | \@a = \@b; # to the same array | |
799 | \%a = \%b; | |
800 | \&a = \&b; | |
801 | foreach \%hash (@array_of_hash_refs) { | |
802 | ... | |
803 | } | |
804 | ||
805 | See L<perlref/Assigning to References> for details. | |
806 | ||
807 | This feature is available from Perl 5.22 onwards. | |
808 | ||
70ea8edf FC |
809 | =head2 The 'bitwise' feature |
810 | ||
70ea8edf FC |
811 | This makes the four standard bitwise operators (C<& | ^ ~>) treat their |
812 | operands consistently as numbers, and introduces four new dotted operators | |
813 | (C<&. |. ^. ~.>) that treat their operands consistently as strings. The | |
814 | same applies to the assignment variants (C<&= |= ^= &.= |.= ^.=>). | |
815 | ||
816 | See L<perlop/Bitwise String Operators> for details. | |
817 | ||
193789ac FC |
818 | This feature is available from Perl 5.22 onwards. Starting in Perl 5.28, |
819 | C<use v5.28> will enable the feature. Before 5.28, it was still | |
820 | experimental and would emit a warning in the "experimental::bitwise" | |
821 | category. | |
70ea8edf | 822 | |
5c703779 FC |
823 | =head2 The 'declared_refs' feature |
824 | ||
825 | B<WARNING>: This feature is still experimental and the implementation may | |
d23c9e49 RS |
826 | change or be removed in future versions of Perl. For this reason, Perl will |
827 | warn when you use the feature, unless you have explicitly disabled the warning: | |
5c703779 FC |
828 | |
829 | no warnings "experimental::declared_refs"; | |
830 | ||
831 | This allows a reference to a variable to be declared with C<my>, C<state>, | |
f91101a0 | 832 | or C<our>, or localized with C<local>. It is intended mainly for use in |
5c703779 FC |
833 | conjunction with the "refaliasing" feature. See L<perlref/Declaring a |
834 | Reference to a Variable> for examples. | |
835 | ||
836 | This feature is available from Perl 5.26 onwards. | |
837 | ||
813e85a0 PE |
838 | =head2 The 'isa' feature |
839 | ||
840 | This allows the use of the C<isa> infix operator, which tests whether the | |
841 | scalar given by the left operand is an object of the class given by the | |
842 | right operand. See L<perlop/Class Instance Operator> for more details. | |
843 | ||
157bd0a3 PE |
844 | This feature is available from Perl 5.32 onwards. From Perl 5.32 to 5.34, |
845 | it was classed as experimental, and Perl emitted a warning for its usage, | |
846 | except when explicitly disabled: | |
847 | ||
848 | no warnings "experimental::isa"; | |
849 | ||
850 | As of Perl 5.36, use of this feature no longer triggers a warning (though the | |
851 | C<experimental::isa> warning category stilll exists for compatibility with | |
02547a38 PE |
852 | code that disables it). This feature is now considered stable, and is enabled |
853 | automatically by C<use v5.36> (or higher). | |
813e85a0 | 854 | |
0b657b19 DIM |
855 | =head2 The 'indirect' feature |
856 | ||
857 | This feature allows the use of L<indirect object | |
858 | syntax|perlobj/Indirect Object Syntax> for method calls, e.g. C<new | |
859 | Foo 1, 2;>. It is enabled by default, but can be turned off to | |
860 | disallow indirect object syntax. | |
861 | ||
862 | This feature is available under this name from Perl 5.32 onwards. In | |
863 | previous versions, it was simply on all the time. To disallow (or | |
864 | warn on) indirect object syntax on older Perls, see the L<indirect> | |
865 | CPAN module. | |
866 | ||
1ad5a39c TC |
867 | =head2 The 'multidimensional' feature |
868 | ||
869 | This feature enables multidimensional array emulation, a perl 4 (or | |
870 | earlier) feature that was used to emulate multidimensional arrays with | |
c7888de9 EAV |
871 | hashes. This works by converting code like C<< $foo{$x, $y} >> into |
872 | C<< $foo{join($;, $x, $y)} >>. It is enabled by default, but can be | |
1ad5a39c TC |
873 | turned off to disable multidimensional array emulation. |
874 | ||
875 | When this feature is disabled the syntax that is normally replaced | |
876 | will report a compilation error. | |
877 | ||
878 | This feature is available under this name from Perl 5.34 onwards. In | |
879 | previous versions, it was simply on all the time. | |
880 | ||
881 | You can use the L<multidimensional> module on CPAN to disable | |
882 | multidimensional array emulation for older versions of Perl. | |
883 | ||
02cf5fb7 | 884 | =head2 The 'bareword_filehandles' feature |
0f2beabb TC |
885 | |
886 | This feature enables bareword filehandles for builtin functions | |
887 | operations, a generally discouraged practice. It is enabled by | |
888 | default, but can be turned off to disable bareword filehandles, except | |
889 | for the exceptions listed below. | |
890 | ||
891 | The perl built-in filehandles C<STDIN>, C<STDOUT>, C<STDERR>, C<DATA>, | |
892 | C<ARGV>, C<ARGVOUT> and the special C<_> are always enabled. | |
893 | ||
a55f7e1b | 894 | This feature is available under this name from Perl 5.34 onwards. In |
eca9683b | 895 | previous versions it was simply on all the time. |
0f2beabb TC |
896 | |
897 | You can use the L<bareword::filehandles> module on CPAN to disable | |
898 | bareword filehandles for older versions of perl. | |
899 | ||
2ef20824 | 900 | =head2 The 'try' feature |
a1325b90 | 901 | |
35b06c4c RS |
902 | B<WARNING>: This feature is still experimental and the implementation may |
903 | change or be removed in future versions of Perl. For this reason, Perl will | |
904 | warn when you use the feature, unless you have explicitly disabled the warning: | |
905 | ||
906 | no warnings "experimental::try"; | |
907 | ||
a1325b90 | 908 | This feature enables the C<try> and C<catch> syntax, which allows exception |
4a485c3e | 909 | handling, where exceptions thrown from the body of the block introduced with |
a1325b90 PE |
910 | C<try> are caught by executing the body of the C<catch> block. |
911 | ||
4035348a C |
912 | This feature is available starting in Perl 5.34. |
913 | ||
a1325b90 PE |
914 | For more information, see L<perlsyn/"Try Catch Exception Handling">. |
915 | ||
f79e2ff9 PE |
916 | =head2 The 'defer' feature |
917 | ||
fd5e27c4 PE |
918 | B<WARNING>: This feature is still experimental and the implementation may |
919 | change or be removed in future versions of Perl. For this reason, Perl will | |
920 | warn when you use the feature, unless you have explicitly disabled the warning: | |
921 | ||
922 | no warnings "experimental::defer"; | |
923 | ||
f79e2ff9 PE |
924 | This feature enables the C<defer> block syntax, which allows a block of code |
925 | to be deferred until when the flow of control leaves the block which contained | |
926 | it. For more details, see L<perlsyn/defer>. | |
927 | ||
4035348a C |
928 | This feature is available starting in Perl 5.36. |
929 | ||
9c9853e8 KW |
930 | =head2 The 'extra_paired_delimiters' feature |
931 | ||
932 | B<WARNING>: This feature is still experimental and the implementation may | |
933 | change or be removed in future versions of Perl. For this reason, Perl will | |
934 | warn when you use the feature, unless you have explicitly disabled the warning: | |
935 | ||
936 | no warnings "experimental::extra_paired_delimiters"; | |
937 | ||
938 | This feature enables the use of more paired string delimiters than the | |
939 | traditional four, S<C<< < > >>>, S<C<( )>>, S<C<{ }>>, and S<C<[ ]>>. When | |
940 | this feature is on, for example, you can say S<C<qrE<171>patE<187>>>. | |
941 | ||
dd834db3 DB |
942 | As with any usage of non-ASCII delimiters in a UTF-8-encoded source file, you |
943 | will want to ensure the parser will decode the source code from UTF-8 bytes | |
944 | with a declaration such as C<use utf8>. | |
945 | ||
9c9853e8 KW |
946 | This feature is available starting in Perl 5.36. |
947 | ||
948 | The complete list of accepted paired delimiters as of Unicode 14.0 is: | |
949 | ||
950 | ( ) U+0028, U+0029 LEFT/RIGHT PARENTHESIS | |
7e4a71c6 | 951 | < > U+003C, U+003E LESS-THAN/GREATER-THAN SIGN |
9c9853e8 KW |
952 | [ ] U+005B, U+005D LEFT/RIGHT SQUARE BRACKET |
953 | { } U+007B, U+007D LEFT/RIGHT CURLY BRACKET | |
954 | « » U+00AB, U+00BB LEFT/RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK | |
835f2666 | 955 | » « U+00BB, U+00AB RIGHT/LEFT-POINTING DOUBLE ANGLE QUOTATION MARK |
210ad843 | 956 | ܆ ܇ U+0706, U+0707 SYRIAC COLON SKEWED LEFT/RIGHT |
9c9853e8 KW |
957 | ༺ ༻ U+0F3A, U+0F3B TIBETAN MARK GUG RTAGS GYON, TIBETAN MARK GUG |
958 | RTAGS GYAS | |
959 | ༼ ༽ U+0F3C, U+0F3D TIBETAN MARK ANG KHANG GYON, TIBETAN MARK ANG | |
960 | KHANG GYAS | |
961 | ᚛ ᚜ U+169B, U+169C OGHAM FEATHER MARK, OGHAM REVERSED FEATHER MARK | |
1df06fae KW |
962 | ‘ ’ U+2018, U+2019 LEFT/RIGHT SINGLE QUOTATION MARK |
963 | ’ ‘ U+2019, U+2018 RIGHT/LEFT SINGLE QUOTATION MARK | |
964 | “ ” U+201C, U+201D LEFT/RIGHT DOUBLE QUOTATION MARK | |
965 | ” “ U+201D, U+201C RIGHT/LEFT DOUBLE QUOTATION MARK | |
210ad843 KW |
966 | ‵ ′ U+2035, U+2032 REVERSED PRIME, PRIME |
967 | ‶ ″ U+2036, U+2033 REVERSED DOUBLE PRIME, DOUBLE PRIME | |
968 | ‷ ‴ U+2037, U+2034 REVERSED TRIPLE PRIME, TRIPLE PRIME | |
9c9853e8 | 969 | ‹ › U+2039, U+203A SINGLE LEFT/RIGHT-POINTING ANGLE QUOTATION MARK |
835f2666 | 970 | › ‹ U+203A, U+2039 SINGLE RIGHT/LEFT-POINTING ANGLE QUOTATION MARK |
9c9853e8 | 971 | ⁅ ⁆ U+2045, U+2046 LEFT/RIGHT SQUARE BRACKET WITH QUILL |
50b17915 | 972 | ⁍ ⁌ U+204D, U+204C BLACK RIGHT/LEFTWARDS BULLET |
9c9853e8 KW |
973 | ⁽ ⁾ U+207D, U+207E SUPERSCRIPT LEFT/RIGHT PARENTHESIS |
974 | ₍ ₎ U+208D, U+208E SUBSCRIPT LEFT/RIGHT PARENTHESIS | |
0b6e3da1 KW |
975 | → ← U+2192, U+2190 RIGHT/LEFTWARDS ARROW |
976 | ↛ ↚ U+219B, U+219A RIGHT/LEFTWARDS ARROW WITH STROKE | |
977 | ↝ ↜ U+219D, U+219C RIGHT/LEFTWARDS WAVE ARROW | |
978 | ↠ ↞ U+21A0, U+219E RIGHT/LEFTWARDS TWO HEADED ARROW | |
979 | ↣ ↢ U+21A3, U+21A2 RIGHT/LEFTWARDS ARROW WITH TAIL | |
980 | ↦ ↤ U+21A6, U+21A4 RIGHT/LEFTWARDS ARROW FROM BAR | |
981 | ↪ ↩ U+21AA, U+21A9 RIGHT/LEFTWARDS ARROW WITH HOOK | |
982 | ↬ ↫ U+21AC, U+21AB RIGHT/LEFTWARDS ARROW WITH LOOP | |
983 | ↱ ↰ U+21B1, U+21B0 UPWARDS ARROW WITH TIP RIGHT/LEFTWARDS | |
984 | ↳ ↲ U+21B3, U+21B2 DOWNWARDS ARROW WITH TIP RIGHT/LEFTWARDS | |
985 | ⇀ ↼ U+21C0, U+21BC RIGHT/LEFTWARDS HARPOON WITH BARB UPWARDS | |
986 | ⇁ ↽ U+21C1, U+21BD RIGHT/LEFTWARDS HARPOON WITH BARB DOWNWARDS | |
987 | ⇉ ⇇ U+21C9, U+21C7 RIGHT/LEFTWARDS PAIRED ARROWS | |
988 | ⇏ ⇍ U+21CF, U+21CD RIGHT/LEFTWARDS DOUBLE ARROW WITH STROKE | |
989 | ⇒ ⇐ U+21D2, U+21D0 RIGHT/LEFTWARDS DOUBLE ARROW | |
990 | ⇛ ⇚ U+21DB, U+21DA RIGHT/LEFTWARDS TRIPLE ARROW | |
991 | ⇝ ⇜ U+21DD, U+21DC RIGHT/LEFTWARDS SQUIGGLE ARROW | |
992 | ⇢ ⇠ U+21E2, U+21E0 RIGHT/LEFTWARDS DASHED ARROW | |
993 | ⇥ ⇤ U+21E5, U+21E4 RIGHT/LEFTWARDS ARROW TO BAR | |
994 | ⇨ ⇦ U+21E8, U+21E6 RIGHT/LEFTWARDS WHITE ARROW | |
995 | ⇴ ⬰ U+21F4, U+2B30 RIGHT/LEFT ARROW WITH SMALL CIRCLE | |
996 | ⇶ ⬱ U+21F6, U+2B31 THREE RIGHT/LEFTWARDS ARROWS | |
997 | ⇸ ⇷ U+21F8, U+21F7 RIGHT/LEFTWARDS ARROW WITH VERTICAL STROKE | |
998 | ⇻ ⇺ U+21FB, U+21FA RIGHT/LEFTWARDS ARROW WITH DOUBLE VERTICAL | |
999 | STROKE | |
1000 | ⇾ ⇽ U+21FE, U+21FD RIGHT/LEFTWARDS OPEN-HEADED ARROW | |
c1b67e77 KW |
1001 | ∈ ∋ U+2208, U+220B ELEMENT OF, CONTAINS AS MEMBER |
1002 | ∉ ∌ U+2209, U+220C NOT AN ELEMENT OF, DOES NOT CONTAIN AS MEMBER | |
1003 | ∊ ∍ U+220A, U+220D SMALL ELEMENT OF, SMALL CONTAINS AS MEMBER | |
7e4a71c6 KW |
1004 | ≤ ≥ U+2264, U+2265 LESS-THAN/GREATER-THAN OR EQUAL TO |
1005 | ≦ ≧ U+2266, U+2267 LESS-THAN/GREATER-THAN OVER EQUAL TO | |
1006 | ≨ ≩ U+2268, U+2269 LESS-THAN/GREATER-THAN BUT NOT EQUAL TO | |
1007 | ≪ ≫ U+226A, U+226B MUCH LESS-THAN/GREATER-THAN | |
1008 | ≮ ≯ U+226E, U+226F NOT LESS-THAN/GREATER-THAN | |
1009 | ≰ ≱ U+2270, U+2271 NEITHER LESS-THAN/GREATER-THAN NOR EQUAL TO | |
1010 | ≲ ≳ U+2272, U+2273 LESS-THAN/GREATER-THAN OR EQUIVALENT TO | |
1011 | ≴ ≵ U+2274, U+2275 NEITHER LESS-THAN/GREATER-THAN NOR EQUIVALENT TO | |
6763e244 KW |
1012 | ≺ ≻ U+227A, U+227B PRECEDES/SUCCEEDS |
1013 | ≼ ≽ U+227C, U+227D PRECEDES/SUCCEEDS OR EQUAL TO | |
1014 | ≾ ≿ U+227E, U+227F PRECEDES/SUCCEEDS OR EQUIVALENT TO | |
1015 | ⊀ ⊁ U+2280, U+2281 DOES NOT PRECEDE/SUCCEED | |
0a4ec1c0 KW |
1016 | ⊂ ⊃ U+2282, U+2283 SUBSET/SUPERSET OF |
1017 | ⊄ ⊅ U+2284, U+2285 NOT A SUBSET/SUPERSET OF | |
1018 | ⊆ ⊇ U+2286, U+2287 SUBSET/SUPERSET OF OR EQUAL TO | |
1019 | ⊈ ⊉ U+2288, U+2289 NEITHER A SUBSET/SUPERSET OF NOR EQUAL TO | |
1020 | ⊊ ⊋ U+228A, U+228B SUBSET/SUPERSET OF WITH NOT EQUAL TO | |
c7c4369b KW |
1021 | ⊣ ⊢ U+22A3, U+22A2 LEFT/RIGHT TACK |
1022 | ⊦ ⫞ U+22A6, U+2ADE ASSERTION, SHORT LEFT TACK | |
84c1ecba KW |
1023 | ⊨ ⫤ U+22A8, U+2AE4 TRUE, VERTICAL BAR DOUBLE LEFT TURNSTILE |
1024 | ⊩ ⫣ U+22A9, U+2AE3 FORCES, DOUBLE VERTICAL BAR LEFT TURNSTILE | |
6763e244 | 1025 | ⊰ ⊱ U+22B0, U+22B1 PRECEDES/SUCCEEDS UNDER RELATION |
0a4ec1c0 | 1026 | ⋐ ⋑ U+22D0, U+22D1 DOUBLE SUBSET/SUPERSET |
7e4a71c6 KW |
1027 | ⋖ ⋗ U+22D6, U+22D7 LESS-THAN/GREATER-THAN WITH DOT |
1028 | ⋘ ⋙ U+22D8, U+22D9 VERY MUCH LESS-THAN/GREATER-THAN | |
1029 | ⋜ ⋝ U+22DC, U+22DD EQUAL TO OR LESS-THAN/GREATER-THAN | |
6763e244 KW |
1030 | ⋞ ⋟ U+22DE, U+22DF EQUAL TO OR PRECEDES/SUCCEEDS |
1031 | ⋠ ⋡ U+22E0, U+22E1 DOES NOT PRECEDE/SUCCEED OR EQUAL | |
7e4a71c6 | 1032 | ⋦ ⋧ U+22E6, U+22E7 LESS-THAN/GREATER-THAN BUT NOT EQUIVALENT TO |
6763e244 | 1033 | ⋨ ⋩ U+22E8, U+22E9 PRECEDES/SUCCEEDS BUT NOT EQUIVALENT TO |
c1b67e77 KW |
1034 | ⋲ ⋺ U+22F2, U+22FA ELEMENT OF/CONTAINS WITH LONG HORIZONTAL STROKE |
1035 | ⋳ ⋻ U+22F3, U+22FB ELEMENT OF/CONTAINS WITH VERTICAL BAR AT END OF | |
1036 | HORIZONTAL STROKE | |
1037 | ⋴ ⋼ U+22F4, U+22FC SMALL ELEMENT OF/CONTAINS WITH VERTICAL BAR AT | |
1038 | END OF HORIZONTAL STROKE | |
1039 | ⋶ ⋽ U+22F6, U+22FD ELEMENT OF/CONTAINS WITH OVERBAR | |
1040 | ⋷ ⋾ U+22F7, U+22FE SMALL ELEMENT OF/CONTAINS WITH OVERBAR | |
9c9853e8 KW |
1041 | ⌈ ⌉ U+2308, U+2309 LEFT/RIGHT CEILING |
1042 | ⌊ ⌋ U+230A, U+230B LEFT/RIGHT FLOOR | |
806eaaf9 | 1043 | ⌦ ⌫ U+2326, U+232B ERASE TO THE RIGHT/LEFT |
9c9853e8 | 1044 | 〈 〉 U+2329, U+232A LEFT/RIGHT-POINTING ANGLE BRACKET |
0b6e3da1 | 1045 | ⍈ ⍇ U+2348, U+2347 APL FUNCTIONAL SYMBOL QUAD RIGHT/LEFTWARDS ARROW |
a29825fb KW |
1046 | ⏩ ⏪ U+23E9, U+23EA BLACK RIGHT/LEFT-POINTING DOUBLE TRIANGLE |
1047 | ⏭ ⏮ U+23ED, U+23EE BLACK RIGHT/LEFT-POINTING DOUBLE TRIANGLE WITH | |
1048 | VERTICAL BAR | |
4a4b7455 KW |
1049 | ☛ ☚ U+261B, U+261A BLACK RIGHT/LEFT POINTING INDEX |
1050 | ☞ ☜ U+261E, U+261C WHITE RIGHT/LEFT POINTING INDEX | |
3e9e4fd8 | 1051 | ⚞ ⚟ U+269E, U+269F THREE LINES CONVERGING RIGHT/LEFT |
9c9853e8 KW |
1052 | ❨ ❩ U+2768, U+2769 MEDIUM LEFT/RIGHT PARENTHESIS ORNAMENT |
1053 | ❪ ❫ U+276A, U+276B MEDIUM FLATTENED LEFT/RIGHT PARENTHESIS ORNAMENT | |
1054 | ❬ ❭ U+276C, U+276D MEDIUM LEFT/RIGHT-POINTING ANGLE BRACKET | |
1055 | ORNAMENT | |
1056 | ❮ ❯ U+276E, U+276F HEAVY LEFT/RIGHT-POINTING ANGLE QUOTATION MARK | |
1057 | ORNAMENT | |
1058 | ❰ ❱ U+2770, U+2771 HEAVY LEFT/RIGHT-POINTING ANGLE BRACKET ORNAMENT | |
1059 | ❲ ❳ U+2772, U+2773 LIGHT LEFT/RIGHT TORTOISE SHELL BRACKET ORNAMENT | |
1060 | ❴ ❵ U+2774, U+2775 MEDIUM LEFT/RIGHT CURLY BRACKET ORNAMENT | |
0a4ec1c0 | 1061 | ⟃ ⟄ U+27C3, U+27C4 OPEN SUBSET/SUPERSET |
9c9853e8 | 1062 | ⟅ ⟆ U+27C5, U+27C6 LEFT/RIGHT S-SHAPED BAG DELIMITER |
0a4ec1c0 KW |
1063 | ⟈ ⟉ U+27C8, U+27C9 REVERSE SOLIDUS PRECEDING SUBSET, SUPERSET |
1064 | PRECEDING SOLIDUS | |
c7c4369b | 1065 | ⟞ ⟝ U+27DE, U+27DD LONG LEFT/RIGHT TACK |
9c9853e8 KW |
1066 | ⟦ ⟧ U+27E6, U+27E7 MATHEMATICAL LEFT/RIGHT WHITE SQUARE BRACKET |
1067 | ⟨ ⟩ U+27E8, U+27E9 MATHEMATICAL LEFT/RIGHT ANGLE BRACKET | |
1068 | ⟪ ⟫ U+27EA, U+27EB MATHEMATICAL LEFT/RIGHT DOUBLE ANGLE BRACKET | |
1069 | ⟬ ⟭ U+27EC, U+27ED MATHEMATICAL LEFT/RIGHT WHITE TORTOISE SHELL | |
1070 | BRACKET | |
1071 | ⟮ ⟯ U+27EE, U+27EF MATHEMATICAL LEFT/RIGHT FLATTENED PARENTHESIS | |
0b6e3da1 KW |
1072 | ⟴ ⬲ U+27F4, U+2B32 RIGHT/LEFT ARROW WITH CIRCLED PLUS |
1073 | ⟶ ⟵ U+27F6, U+27F5 LONG RIGHT/LEFTWARDS ARROW | |
1074 | ⟹ ⟸ U+27F9, U+27F8 LONG RIGHT/LEFTWARDS DOUBLE ARROW | |
1075 | ⟼ ⟻ U+27FC, U+27FB LONG RIGHT/LEFTWARDS ARROW FROM BAR | |
1076 | ⟾ ⟽ U+27FE, U+27FD LONG RIGHT/LEFTWARDS DOUBLE ARROW FROM BAR | |
1077 | ⟿ ⬳ U+27FF, U+2B33 LONG RIGHT/LEFTWARDS SQUIGGLE ARROW | |
1078 | ⤀ ⬴ U+2900, U+2B34 RIGHT/LEFTWARDS TWO-HEADED ARROW WITH VERTICAL | |
1079 | STROKE | |
1080 | ⤁ ⬵ U+2901, U+2B35 RIGHT/LEFTWARDS TWO-HEADED ARROW WITH DOUBLE | |
1081 | VERTICAL STROKE | |
1082 | ⤃ ⤂ U+2903, U+2902 RIGHT/LEFTWARDS DOUBLE ARROW WITH VERTICAL | |
1083 | STROKE | |
1084 | ⤅ ⬶ U+2905, U+2B36 RIGHT/LEFTWARDS TWO-HEADED ARROW FROM BAR | |
1085 | ⤇ ⤆ U+2907, U+2906 RIGHT/LEFTWARDS DOUBLE ARROW FROM BAR | |
1086 | ⤍ ⤌ U+290D, U+290C RIGHT/LEFTWARDS DOUBLE DASH ARROW | |
1087 | ⤏ ⤎ U+290F, U+290E RIGHT/LEFTWARDS TRIPLE DASH ARROW | |
1088 | ⤐ ⬷ U+2910, U+2B37 RIGHT/LEFTWARDS TWO-HEADED TRIPLE DASH ARROW | |
1089 | ⤑ ⬸ U+2911, U+2B38 RIGHT/LEFTWARDS ARROW WITH DOTTED STEM | |
1090 | ⤔ ⬹ U+2914, U+2B39 RIGHT/LEFTWARDS ARROW WITH TAIL WITH VERTICAL | |
1091 | STROKE | |
1092 | ⤕ ⬺ U+2915, U+2B3A RIGHT/LEFTWARDS ARROW WITH TAIL WITH DOUBLE | |
1093 | VERTICAL STROKE | |
1094 | ⤖ ⬻ U+2916, U+2B3B RIGHT/LEFTWARDS TWO-HEADED ARROW WITH TAIL | |
1095 | ⤗ ⬼ U+2917, U+2B3C RIGHT/LEFTWARDS TWO-HEADED ARROW WITH TAIL WITH | |
1096 | VERTICAL STROKE | |
1097 | ⤘ ⬽ U+2918, U+2B3D RIGHT/LEFTWARDS TWO-HEADED ARROW WITH TAIL WITH | |
1098 | DOUBLE VERTICAL STROKE | |
1099 | ⤚ ⤙ U+291A, U+2919 RIGHT/LEFTWARDS ARROW-TAIL | |
1100 | ⤜ ⤛ U+291C, U+291B RIGHT/LEFTWARDS DOUBLE ARROW-TAIL | |
1101 | ⤞ ⤝ U+291E, U+291D RIGHT/LEFTWARDS ARROW TO BLACK DIAMOND | |
1102 | ⤠ ⤟ U+2920, U+291F RIGHT/LEFTWARDS ARROW FROM BAR TO BLACK DIAMOND | |
1103 | ⤳ ⬿ U+2933, U+2B3F WAVE ARROW POINTING DIRECTLY RIGHT/LEFT | |
1104 | ⤷ ⤶ U+2937, U+2936 ARROW POINTING DOWNWARDS THEN CURVING RIGHT/ | |
1105 | LEFTWARDS | |
1106 | ⥅ ⥆ U+2945, U+2946 RIGHT/LEFTWARDS ARROW WITH PLUS BELOW | |
1107 | ⥇ ⬾ U+2947, U+2B3E RIGHT/LEFTWARDS ARROW THROUGH X | |
1108 | ⥓ ⥒ U+2953, U+2952 RIGHT/LEFTWARDS HARPOON WITH BARB UP TO BAR | |
1109 | ⥗ ⥖ U+2957, U+2956 RIGHT/LEFTWARDS HARPOON WITH BARB DOWN TO BAR | |
1110 | ⥛ ⥚ U+295B, U+295A RIGHT/LEFTWARDS HARPOON WITH BARB UP FROM BAR | |
1111 | ⥟ ⥞ U+295F, U+295E RIGHT/LEFTWARDS HARPOON WITH BARB DOWN FROM BAR | |
1112 | ⥤ ⥢ U+2964, U+2962 RIGHT/LEFTWARDS HARPOON WITH BARB UP ABOVE | |
1113 | RIGHT/LEFTWARDS HARPOON WITH BARB DOWN | |
1114 | ⥬ ⥪ U+296C, U+296A RIGHT/LEFTWARDS HARPOON WITH BARB UP ABOVE LONG | |
1115 | DASH | |
1116 | ⥭ ⥫ U+296D, U+296B RIGHT/LEFTWARDS HARPOON WITH BARB DOWN BELOW | |
1117 | LONG DASH | |
1118 | ⥱ ⭀ U+2971, U+2B40 EQUALS SIGN ABOVE RIGHT/LEFTWARDS ARROW | |
1119 | ⥲ ⭁ U+2972, U+2B41 TILDE OPERATOR ABOVE RIGHTWARDS ARROW, REVERSE | |
1120 | TILDE OPERATOR ABOVE LEFTWARDS ARROW | |
1121 | ⥴ ⭋ U+2974, U+2B4B RIGHTWARDS ARROW ABOVE TILDE OPERATOR, | |
1122 | LEFTWARDS ARROW ABOVE REVERSE TILDE OPERATOR | |
1123 | ⥵ ⭂ U+2975, U+2B42 RIGHTWARDS ARROW ABOVE ALMOST EQUAL TO, | |
1124 | LEFTWARDS ARROW ABOVE REVERSE ALMOST EQUAL TO | |
1125 | ⥹ ⥻ U+2979, U+297B SUBSET/SUPERSET ABOVE RIGHT/LEFTWARDS ARROW | |
9c9853e8 KW |
1126 | ⦃ ⦄ U+2983, U+2984 LEFT/RIGHT WHITE CURLY BRACKET |
1127 | ⦅ ⦆ U+2985, U+2986 LEFT/RIGHT WHITE PARENTHESIS | |
1128 | ⦇ ⦈ U+2987, U+2988 Z NOTATION LEFT/RIGHT IMAGE BRACKET | |
1129 | ⦉ ⦊ U+2989, U+298A Z NOTATION LEFT/RIGHT BINDING BRACKET | |
1130 | ⦋ ⦌ U+298B, U+298C LEFT/RIGHT SQUARE BRACKET WITH UNDERBAR | |
1131 | ⦍ ⦐ U+298D, U+2990 LEFT/RIGHT SQUARE BRACKET WITH TICK IN TOP | |
1132 | CORNER | |
1133 | ⦏ ⦎ U+298F, U+298E LEFT/RIGHT SQUARE BRACKET WITH TICK IN BOTTOM | |
1134 | CORNER | |
1135 | ⦑ ⦒ U+2991, U+2992 LEFT/RIGHT ANGLE BRACKET WITH DOT | |
7e4a71c6 KW |
1136 | ⦓ ⦔ U+2993, U+2994 LEFT/RIGHT ARC LESS-THAN/GREATER-THAN BRACKET |
1137 | ⦕ ⦖ U+2995, U+2996 DOUBLE LEFT/RIGHT ARC GREATER-THAN/LESS-THAN | |
1138 | BRACKET | |
9c9853e8 | 1139 | ⦗ ⦘ U+2997, U+2998 LEFT/RIGHT BLACK TORTOISE SHELL BRACKET |
0b6e3da1 KW |
1140 | ⦨ ⦩ U+29A8, U+29A9 MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW |
1141 | POINTING UP AND RIGHT/LEFT | |
1142 | ⦪ ⦫ U+29AA, U+29AB MEASURED ANGLE WITH OPEN ARM ENDING IN ARROW | |
1143 | POINTING DOWN AND RIGHT/LEFT | |
1144 | ⦳ ⦴ U+29B3, U+29B4 EMPTY SET WITH RIGHT/LEFT ARROW ABOVE | |
7e4a71c6 | 1145 | ⧀ ⧁ U+29C0, U+29C1 CIRCLED LESS-THAN/GREATER-THAN |
9c9853e8 KW |
1146 | ⧘ ⧙ U+29D8, U+29D9 LEFT/RIGHT WIGGLY FENCE |
1147 | ⧚ ⧛ U+29DA, U+29DB LEFT/RIGHT DOUBLE WIGGLY FENCE | |
1148 | ⧼ ⧽ U+29FC, U+29FD LEFT/RIGHT-POINTING CURVED ANGLE BRACKET | |
7e4a71c6 KW |
1149 | ⩹ ⩺ U+2A79, U+2A7A LESS-THAN/GREATER-THAN WITH CIRCLE INSIDE |
1150 | ⩻ ⩼ U+2A7B, U+2A7C LESS-THAN/GREATER-THAN WITH QUESTION MARK ABOVE | |
1151 | ⩽ ⩾ U+2A7D, U+2A7E LESS-THAN/GREATER-THAN OR SLANTED EQUAL TO | |
1152 | ⩿ ⪀ U+2A7F, U+2A80 LESS-THAN/GREATER-THAN OR SLANTED EQUAL TO WITH | |
1153 | DOT INSIDE | |
1154 | ⪁ ⪂ U+2A81, U+2A82 LESS-THAN/GREATER-THAN OR SLANTED EQUAL TO WITH | |
1155 | DOT ABOVE | |
1156 | ⪃ ⪄ U+2A83, U+2A84 LESS-THAN/GREATER-THAN OR SLANTED EQUAL TO WITH | |
1157 | DOT ABOVE RIGHT/LEFT | |
1158 | ⪅ ⪆ U+2A85, U+2A86 LESS-THAN/GREATER-THAN OR APPROXIMATE | |
1159 | ⪇ ⪈ U+2A87, U+2A88 LESS-THAN/GREATER-THAN AND SINGLE-LINE NOT | |
1160 | EQUAL TO | |
1161 | ⪉ ⪊ U+2A89, U+2A8A LESS-THAN/GREATER-THAN AND NOT APPROXIMATE | |
1162 | ⪍ ⪎ U+2A8D, U+2A8E LESS-THAN/GREATER-THAN ABOVE SIMILAR OR EQUAL | |
1163 | ⪕ ⪖ U+2A95, U+2A96 SLANTED EQUAL TO OR LESS-THAN/GREATER-THAN | |
1164 | ⪗ ⪘ U+2A97, U+2A98 SLANTED EQUAL TO OR LESS-THAN/GREATER-THAN WITH | |
1165 | DOT INSIDE | |
1166 | ⪙ ⪚ U+2A99, U+2A9A DOUBLE-LINE EQUAL TO OR LESS-THAN/GREATER-THAN | |
1167 | ⪛ ⪜ U+2A9B, U+2A9C DOUBLE-LINE SLANTED EQUAL TO OR LESS-THAN/ | |
1168 | GREATER-THAN | |
1169 | ⪝ ⪞ U+2A9D, U+2A9E SIMILAR OR LESS-THAN/GREATER-THAN | |
1170 | ⪟ ⪠ U+2A9F, U+2AA0 SIMILAR ABOVE LESS-THAN/GREATER-THAN ABOVE | |
1171 | EQUALS SIGN | |
1172 | ⪡ ⪢ U+2AA1, U+2AA2 DOUBLE NESTED LESS-THAN/GREATER-THAN | |
1173 | ⪦ ⪧ U+2AA6, U+2AA7 LESS-THAN/GREATER-THAN CLOSED BY CURVE | |
1174 | ⪨ ⪩ U+2AA8, U+2AA9 LESS-THAN/GREATER-THAN CLOSED BY CURVE ABOVE | |
1175 | SLANTED EQUAL | |
36327261 KW |
1176 | ⪪ ⪫ U+2AAA, U+2AAB SMALLER THAN/LARGER THAN |
1177 | ⪬ ⪭ U+2AAC, U+2AAD SMALLER THAN/LARGER THAN OR EQUAL TO | |
6763e244 KW |
1178 | ⪯ ⪰ U+2AAF, U+2AB0 PRECEDES/SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN |
1179 | ⪱ ⪲ U+2AB1, U+2AB2 PRECEDES/SUCCEEDS ABOVE SINGLE-LINE NOT EQUAL TO | |
1180 | ⪳ ⪴ U+2AB3, U+2AB4 PRECEDES/SUCCEEDS ABOVE EQUALS SIGN | |
1181 | ⪵ ⪶ U+2AB5, U+2AB6 PRECEDES/SUCCEEDS ABOVE NOT EQUAL TO | |
1182 | ⪷ ⪸ U+2AB7, U+2AB8 PRECEDES/SUCCEEDS ABOVE ALMOST EQUAL TO | |
1183 | ⪹ ⪺ U+2AB9, U+2ABA PRECEDES/SUCCEEDS ABOVE NOT ALMOST EQUAL TO | |
1184 | ⪻ ⪼ U+2ABB, U+2ABC DOUBLE PRECEDES/SUCCEEDS | |
0a4ec1c0 KW |
1185 | ⪽ ⪾ U+2ABD, U+2ABE SUBSET/SUPERSET WITH DOT |
1186 | ⪿ ⫀ U+2ABF, U+2AC0 SUBSET/SUPERSET WITH PLUS SIGN BELOW | |
1187 | ⫁ ⫂ U+2AC1, U+2AC2 SUBSET/SUPERSET WITH MULTIPLICATION SIGN BELOW | |
1188 | ⫃ ⫄ U+2AC3, U+2AC4 SUBSET/SUPERSET OF OR EQUAL TO WITH DOT ABOVE | |
1189 | ⫅ ⫆ U+2AC5, U+2AC6 SUBSET/SUPERSET OF ABOVE EQUALS SIGN | |
1190 | ⫇ ⫈ U+2AC7, U+2AC8 SUBSET/SUPERSET OF ABOVE TILDE OPERATOR | |
1191 | ⫉ ⫊ U+2AC9, U+2ACA SUBSET/SUPERSET OF ABOVE ALMOST EQUAL TO | |
1192 | ⫋ ⫌ U+2ACB, U+2ACC SUBSET/SUPERSET OF ABOVE NOT EQUAL TO | |
1193 | ⫏ ⫐ U+2ACF, U+2AD0 CLOSED SUBSET/SUPERSET | |
1194 | ⫑ ⫒ U+2AD1, U+2AD2 CLOSED SUBSET/SUPERSET OR EQUAL TO | |
1195 | ⫕ ⫖ U+2AD5, U+2AD6 SUBSET/SUPERSET ABOVE SUBSET/SUPERSET | |
84c1ecba | 1196 | ⫥ ⊫ U+2AE5, U+22AB DOUBLE VERTICAL BAR DOUBLE LEFT/RIGHT TURNSTILE |
7e4a71c6 KW |
1197 | ⫷ ⫸ U+2AF7, U+2AF8 TRIPLE NESTED LESS-THAN/GREATER-THAN |
1198 | ⫹ ⫺ U+2AF9, U+2AFA DOUBLE-LINE SLANTED LESS-THAN/GREATER-THAN OR | |
1199 | EQUAL TO | |
0b6e3da1 KW |
1200 | ⭆ ⭅ U+2B46, U+2B45 RIGHT/LEFTWARDS QUADRUPLE ARROW |
1201 | ⭇ ⭉ U+2B47, U+2B49 REVERSE TILDE OPERATOR ABOVE RIGHTWARDS ARROW, | |
1202 | TILDE OPERATOR ABOVE LEFTWARDS ARROW | |
1203 | ⭈ ⭊ U+2B48, U+2B4A RIGHTWARDS ARROW ABOVE REVERSE ALMOST EQUAL | |
1204 | TO, LEFTWARDS ARROW ABOVE ALMOST EQUAL TO | |
1205 | ⭌ ⥳ U+2B4C, U+2973 RIGHTWARDS ARROW ABOVE REVERSE TILDE OPERATOR, | |
1206 | LEFTWARDS ARROW ABOVE TILDE OPERATOR | |
1207 | ⭢ ⭠ U+2B62, U+2B60 RIGHT/LEFTWARDS TRIANGLE-HEADED ARROW | |
1208 | ⭬ ⭪ U+2B6C, U+2B6A RIGHT/LEFTWARDS TRIANGLE-HEADED DASHED ARROW | |
1209 | ⭲ ⭰ U+2B72, U+2B70 RIGHT/LEFTWARDS TRIANGLE-HEADED ARROW TO BAR | |
1210 | ⭼ ⭺ U+2B7C, U+2B7A RIGHT/LEFTWARDS TRIANGLE-HEADED ARROW WITH | |
1211 | DOUBLE VERTICAL STROKE | |
1212 | ⮆ ⮄ U+2B86, U+2B84 RIGHT/LEFTWARDS TRIANGLE-HEADED PAIRED ARROWS | |
1213 | ⮊ ⮈ U+2B8A, U+2B88 RIGHT/LEFTWARDS BLACK CIRCLED WHITE ARROW | |
1214 | ⮕ ⬅ U+2B95, U+2B05 RIGHT/LEFTWARDS BLACK ARROW | |
1215 | ⮚ ⮘ U+2B9A, U+2B98 THREE-D TOP-LIGHTED RIGHT/LEFTWARDS EQUILATERAL | |
1216 | ARROWHEAD | |
1217 | ⮞ ⮜ U+2B9E, U+2B9C BLACK RIGHT/LEFTWARDS EQUILATERAL ARROWHEAD | |
1218 | ⮡ ⮠ U+2BA1, U+2BA0 DOWNWARDS TRIANGLE-HEADED ARROW WITH LONG TIP | |
1219 | RIGHT/LEFTWARDS | |
1220 | ⮣ ⮢ U+2BA3, U+2BA2 UPWARDS TRIANGLE-HEADED ARROW WITH LONG TIP | |
1221 | RIGHT/LEFTWARDS | |
1222 | ⮩ ⮨ U+2BA9, U+2BA8 BLACK CURVED DOWNWARDS AND RIGHT/LEFTWARDS ARROW | |
1223 | ⮫ ⮪ U+2BAB, U+2BAA BLACK CURVED UPWARDS AND RIGHT/LEFTWARDS ARROW | |
1224 | ⮱ ⮰ U+2BB1, U+2BB0 RIBBON ARROW DOWN RIGHT/LEFT | |
1225 | ⮳ ⮲ U+2BB3, U+2BB2 RIBBON ARROW UP RIGHT/LEFT | |
1226 | ⯮ ⯬ U+2BEE, U+2BEC RIGHT/LEFTWARDS TWO-HEADED ARROW WITH TRIANGLE | |
1227 | ARROWHEADS | |
9c9853e8 | 1228 | ⸂ ⸃ U+2E02, U+2E03 LEFT/RIGHT SUBSTITUTION BRACKET |
835f2666 | 1229 | ⸃ ⸂ U+2E03, U+2E02 RIGHT/LEFT SUBSTITUTION BRACKET |
9c9853e8 | 1230 | ⸄ ⸅ U+2E04, U+2E05 LEFT/RIGHT DOTTED SUBSTITUTION BRACKET |
835f2666 | 1231 | ⸅ ⸄ U+2E05, U+2E04 RIGHT/LEFT DOTTED SUBSTITUTION BRACKET |
9c9853e8 | 1232 | ⸉ ⸊ U+2E09, U+2E0A LEFT/RIGHT TRANSPOSITION BRACKET |
835f2666 | 1233 | ⸊ ⸉ U+2E0A, U+2E09 RIGHT/LEFT TRANSPOSITION BRACKET |
9c9853e8 | 1234 | ⸌ ⸍ U+2E0C, U+2E0D LEFT/RIGHT RAISED OMISSION BRACKET |
835f2666 | 1235 | ⸍ ⸌ U+2E0D, U+2E0C RIGHT/LEFT RAISED OMISSION BRACKET |
210ad843 | 1236 | ⸑ ⸐ U+2E11, U+2E10 REVERSED FORKED PARAGRAPHOS, FORKED PARAGRAPHOS |
9c9853e8 | 1237 | ⸜ ⸝ U+2E1C, U+2E1D LEFT/RIGHT LOW PARAPHRASE BRACKET |
835f2666 | 1238 | ⸝ ⸜ U+2E1D, U+2E1C RIGHT/LEFT LOW PARAPHRASE BRACKET |
9c9853e8 | 1239 | ⸠ ⸡ U+2E20, U+2E21 LEFT/RIGHT VERTICAL BAR WITH QUILL |
835f2666 | 1240 | ⸡ ⸠ U+2E21, U+2E20 RIGHT/LEFT VERTICAL BAR WITH QUILL |
9c9853e8 KW |
1241 | ⸢ ⸣ U+2E22, U+2E23 TOP LEFT/RIGHT HALF BRACKET |
1242 | ⸤ ⸥ U+2E24, U+2E25 BOTTOM LEFT/RIGHT HALF BRACKET | |
1243 | ⸦ ⸧ U+2E26, U+2E27 LEFT/RIGHT SIDEWAYS U BRACKET | |
1244 | ⸨ ⸩ U+2E28, U+2E29 LEFT/RIGHT DOUBLE PARENTHESIS | |
210ad843 | 1245 | ⸶ ⸷ U+2E36, U+2E37 DAGGER WITH LEFT/RIGHT GUARD |
565fbe1b KW |
1246 | ⹂ „ U+2E42, U+201E DOUBLE LOW-REVERSED-9 QUOTATION MARK, DOUBLE |
1247 | LOW-9 QUOTATION MARK | |
9c9853e8 KW |
1248 | ⹕ ⹖ U+2E55, U+2E56 LEFT/RIGHT SQUARE BRACKET WITH STROKE |
1249 | ⹗ ⹘ U+2E57, U+2E58 LEFT/RIGHT SQUARE BRACKET WITH DOUBLE STROKE | |
1250 | ⹙ ⹚ U+2E59, U+2E5A TOP HALF LEFT/RIGHT PARENTHESIS | |
1251 | ⹛ ⹜ U+2E5B, U+2E5C BOTTOM HALF LEFT/RIGHT PARENTHESIS | |
1252 | 〈 〉 U+3008, U+3009 LEFT/RIGHT ANGLE BRACKET | |
1253 | 《 》 U+300A, U+300B LEFT/RIGHT DOUBLE ANGLE BRACKET | |
1254 | 「 」 U+300C, U+300D LEFT/RIGHT CORNER BRACKET | |
1255 | 『 』 U+300E, U+300F LEFT/RIGHT WHITE CORNER BRACKET | |
1256 | 【 】 U+3010, U+3011 LEFT/RIGHT BLACK LENTICULAR BRACKET | |
1257 | 〔 〕 U+3014, U+3015 LEFT/RIGHT TORTOISE SHELL BRACKET | |
1258 | 〖 〗 U+3016, U+3017 LEFT/RIGHT WHITE LENTICULAR BRACKET | |
1259 | 〘 〙 U+3018, U+3019 LEFT/RIGHT WHITE TORTOISE SHELL BRACKET | |
1260 | 〚 〛 U+301A, U+301B LEFT/RIGHT WHITE SQUARE BRACKET | |
565fbe1b KW |
1261 | 〝 〞 U+301D, U+301E REVERSED DOUBLE PRIME QUOTATION MARK, DOUBLE |
1262 | PRIME QUOTATION MARK | |
210ad843 KW |
1263 | ꧁ ꧂ U+A9C1, U+A9C2 JAVANESE LEFT/RIGHT RERENGGAN |
1264 | ﴾ ﴿ U+FD3E, U+FD3F ORNATE LEFT/RIGHT PARENTHESIS | |
9c9853e8 KW |
1265 | ﹙ ﹚ U+FE59, U+FE5A SMALL LEFT/RIGHT PARENTHESIS |
1266 | ﹛ ﹜ U+FE5B, U+FE5C SMALL LEFT/RIGHT CURLY BRACKET | |
1267 | ﹝ ﹞ U+FE5D, U+FE5E SMALL LEFT/RIGHT TORTOISE SHELL BRACKET | |
7e4a71c6 | 1268 | ﹤ ﹥ U+FE64, U+FE65 SMALL LESS-THAN/GREATER-THAN SIGN |
9c9853e8 | 1269 | ( ) U+FF08, U+FF09 FULLWIDTH LEFT/RIGHT PARENTHESIS |
7e4a71c6 | 1270 | < > U+FF1C, U+FF1E FULLWIDTH LESS-THAN/GREATER-THAN SIGN |
9c9853e8 KW |
1271 | [ ] U+FF3B, U+FF3D FULLWIDTH LEFT/RIGHT SQUARE BRACKET |
1272 | { } U+FF5B, U+FF5D FULLWIDTH LEFT/RIGHT CURLY BRACKET | |
1273 | ⦅ ⦆ U+FF5F, U+FF60 FULLWIDTH LEFT/RIGHT WHITE PARENTHESIS | |
1274 | 「 」 U+FF62, U+FF63 HALFWIDTH LEFT/RIGHT CORNER BRACKET | |
0b6e3da1 | 1275 | → ← U+FFEB, U+FFE9 HALFWIDTH RIGHT/LEFTWARDS ARROW |
3e9e4fd8 KW |
1276 | 𝄃 𝄂 U+1D103, U+1D102 MUSICAL SYMBOL REVERSE FINAL BARLINE, MUSICAL |
1277 | SYMBOL FINAL BARLINE | |
1278 | 𝄆 𝄇 U+1D106, U+1D107 MUSICAL SYMBOL LEFT/RIGHT REPEAT SIGN | |
4a4b7455 | 1279 | 👉 👈 U+1F449, U+1F448 WHITE RIGHT/LEFT POINTING BACKHAND INDEX |
a863e562 KW |
1280 | 🔈 🕨 U+1F508, U+1F568 SPEAKER, RIGHT SPEAKER |
1281 | 🔉 🕩 U+1F509, U+1F569 SPEAKER WITH ONE SOUND WAVE, RIGHT SPEAKER WITH | |
1282 | ONE SOUND WAVE | |
1283 | 🔊 🕪 U+1F50A, U+1F56A SPEAKER WITH THREE SOUND WAVES, RIGHT SPEAKER | |
1284 | WITH THREE SOUND WAVES | |
ad558b4e | 1285 | 🕻 🕽 U+1F57B, U+1F57D LEFT/RIGHT HAND TELEPHONE RECEIVER |
4a4b7455 KW |
1286 | 🖙 🖘 U+1F599, U+1F598 SIDEWAYS WHITE RIGHT/LEFT POINTING INDEX |
1287 | 🖛 🖚 U+1F59B, U+1F59A SIDEWAYS BLACK RIGHT/LEFT POINTING INDEX | |
1288 | 🖝 🖜 U+1F59D, U+1F59C BLACK RIGHT/LEFT POINTING BACKHAND INDEX | |
e73a9e14 | 1289 | 🗦 🗧 U+1F5E6, U+1F5E7 THREE RAYS LEFT/RIGHT |
0b6e3da1 KW |
1290 | 🠂 🠀 U+1F802, U+1F800 RIGHT/LEFTWARDS ARROW WITH SMALL TRIANGLE |
1291 | ARROWHEAD | |
1292 | 🠆 🠄 U+1F806, U+1F804 RIGHT/LEFTWARDS ARROW WITH MEDIUM TRIANGLE | |
1293 | ARROWHEAD | |
1294 | 🠊 🠈 U+1F80A, U+1F808 RIGHT/LEFTWARDS ARROW WITH LARGE TRIANGLE | |
1295 | ARROWHEAD | |
1296 | 🠒 🠐 U+1F812, U+1F810 RIGHT/LEFTWARDS ARROW WITH SMALL EQUILATERAL | |
1297 | ARROWHEAD | |
1298 | 🠖 🠔 U+1F816, U+1F814 RIGHT/LEFTWARDS ARROW WITH EQUILATERAL ARROWHEAD | |
1299 | 🠚 🠘 U+1F81A, U+1F818 HEAVY RIGHT/LEFTWARDS ARROW WITH EQUILATERAL | |
1300 | ARROWHEAD | |
1301 | 🠞 🠜 U+1F81E, U+1F81C HEAVY RIGHT/LEFTWARDS ARROW WITH LARGE | |
1302 | EQUILATERAL ARROWHEAD | |
1303 | 🠢 🠠 U+1F822, U+1F820 RIGHT/LEFTWARDS TRIANGLE-HEADED ARROW WITH | |
1304 | NARROW SHAFT | |
1305 | 🠦 🠤 U+1F826, U+1F824 RIGHT/LEFTWARDS TRIANGLE-HEADED ARROW WITH | |
1306 | MEDIUM SHAFT | |
1307 | 🠪 🠨 U+1F82A, U+1F828 RIGHT/LEFTWARDS TRIANGLE-HEADED ARROW WITH BOLD | |
1308 | SHAFT | |
1309 | 🠮 🠬 U+1F82E, U+1F82C RIGHT/LEFTWARDS TRIANGLE-HEADED ARROW WITH | |
1310 | HEAVY SHAFT | |
1311 | 🠲 🠰 U+1F832, U+1F830 RIGHT/LEFTWARDS TRIANGLE-HEADED ARROW WITH VERY | |
1312 | HEAVY SHAFT | |
1313 | 🠶 🠴 U+1F836, U+1F834 RIGHT/LEFTWARDS FINGER-POST ARROW | |
1314 | 🠺 🠸 U+1F83A, U+1F838 RIGHT/LEFTWARDS SQUARED ARROW | |
1315 | 🠾 🠼 U+1F83E, U+1F83C RIGHT/LEFTWARDS COMPRESSED ARROW | |
1316 | 🡂 🡀 U+1F842, U+1F840 RIGHT/LEFTWARDS HEAVY COMPRESSED ARROW | |
1317 | 🡆 🡄 U+1F846, U+1F844 RIGHT/LEFTWARDS HEAVY ARROW | |
1318 | 🡒 🡐 U+1F852, U+1F850 RIGHT/LEFTWARDS SANS-SERIF ARROW | |
1319 | 🡢 🡠 U+1F862, U+1F860 WIDE-HEADED RIGHT/LEFTWARDS LIGHT BARB ARROW | |
1320 | 🡪 🡨 U+1F86A, U+1F868 WIDE-HEADED RIGHT/LEFTWARDS BARB ARROW | |
1321 | 🡲 🡰 U+1F872, U+1F870 WIDE-HEADED RIGHT/LEFTWARDS MEDIUM BARB ARROW | |
1322 | 🡺 🡸 U+1F87A, U+1F878 WIDE-HEADED RIGHT/LEFTWARDS HEAVY BARB ARROW | |
1323 | 🢂 🢀 U+1F882, U+1F880 WIDE-HEADED RIGHT/LEFTWARDS VERY HEAVY BARB | |
1324 | ARROW | |
1325 | 🢒 🢐 U+1F892, U+1F890 RIGHT/LEFTWARDS TRIANGLE ARROWHEAD | |
1326 | 🢖 🢔 U+1F896, U+1F894 RIGHT/LEFTWARDS WHITE ARROW WITHIN TRIANGLE | |
1327 | ARROWHEAD | |
1328 | 🢚 🢘 U+1F89A, U+1F898 RIGHT/LEFTWARDS ARROW WITH NOTCHED TAIL | |
1329 | 🢡 🢠 U+1F8A1, U+1F8A0 RIGHTWARDS BOTTOM SHADED WHITE ARROW, | |
1330 | LEFTWARDS BOTTOM-SHADED WHITE ARROW | |
1331 | 🢣 🢢 U+1F8A3, U+1F8A2 RIGHT/LEFTWARDS TOP SHADED WHITE ARROW | |
1332 | 🢥 🢦 U+1F8A5, U+1F8A6 RIGHT/LEFTWARDS RIGHT-SHADED WHITE ARROW | |
1333 | 🢧 🢤 U+1F8A7, U+1F8A4 RIGHT/LEFTWARDS LEFT-SHADED WHITE ARROW | |
1334 | 🢩 🢨 U+1F8A9, U+1F8A8 RIGHT/LEFTWARDS BACK-TILTED SHADOWED WHITE ARROW | |
1335 | 🢫 🢪 U+1F8AB, U+1F8AA RIGHT/LEFTWARDS FRONT-TILTED SHADOWED WHITE | |
1336 | ARROW | |
9c9853e8 | 1337 | |
1102a6f0 | 1338 | =head2 The 'module_true' feature |
1339 | ||
1340 | This feature removes the need to return a true value at the end of a module | |
1341 | loaded with C<require> or C<use>. Any errors during compilation will cause | |
1342 | failures, but reaching the end of the module when this feature is in effect | |
1343 | will prevent C<perl> from throwing an exception that the module "did not return | |
1344 | a true value". | |
1345 | ||
99b497aa PE |
1346 | =head2 The 'class' feature |
1347 | ||
1348 | B<WARNING>: This feature is still experimental and the implementation may | |
1349 | change or be removed in future versions of Perl. For this reason, Perl will | |
1350 | warn when you use the feature, unless you have explicitly disabled the warning: | |
1351 | ||
1352 | no warnings "experimental::class"; | |
1353 | ||
1354 | This feature enables the C<class> block syntax and other associated keywords | |
1355 | which implement the "new" object system, previously codenamed "Corinna". | |
1356 | ||
69bcf1d3 FC |
1357 | =head1 FEATURE BUNDLES |
1358 | ||
1359 | It's possible to load multiple features together, using | |
1360 | a I<feature bundle>. The name of a feature bundle is prefixed with | |
1361 | a colon, to distinguish it from an actual feature. | |
1362 | ||
1363 | use feature ":5.10"; | |
1364 | ||
1365 | The following feature bundles are available: | |
1366 | ||
1367 | bundle features included | |
1368 | --------- ----------------- | |
2b3fe414 | 1369 | PODTURES |
69bcf1d3 FC |
1370 | The C<:default> bundle represents the feature set that is enabled before |
1371 | any C<use feature> or C<no feature> declaration. | |
1372 | ||
1373 | Specifying sub-versions such as the C<0> in C<5.14.0> in feature bundles has | |
1374 | no effect. Feature bundles are guaranteed to be the same for all sub-versions. | |
1375 | ||
1376 | use feature ":5.14.0"; # same as ":5.14" | |
1377 | use feature ":5.14.1"; # same as ":5.14" | |
1378 | ||
fc5e0674 TC |
1379 | You can also do: |
1380 | ||
1381 | use feature ":all"; | |
1382 | ||
1383 | or | |
1384 | ||
1385 | no feature ":all"; | |
1386 | ||
1387 | but the first may enable features in a later version of Perl that | |
1388 | change the meaning of your code, and the second may disable mechanisms | |
1389 | that are part of Perl's current behavior that have been turned into | |
1390 | features, just as C<indirect> and C<bareword_filehandles> were. | |
1391 | ||
69bcf1d3 FC |
1392 | =head1 IMPLICIT LOADING |
1393 | ||
1394 | Instead of loading feature bundles by name, it is easier to let Perl do | |
1395 | implicit loading of a feature bundle for you. | |
1396 | ||
1397 | There are two ways to load the C<feature> pragma implicitly: | |
1398 | ||
1399 | =over 4 | |
1400 | ||
1401 | =item * | |
1402 | ||
1403 | By using the C<-E> switch on the Perl command-line instead of C<-e>. | |
1404 | That will enable the feature bundle for that version of Perl in the | |
1405 | main compilation unit (that is, the one-liner that follows C<-E>). | |
1406 | ||
1407 | =item * | |
1408 | ||
1409 | By explicitly requiring a minimum Perl version number for your program, with | |
1410 | the C<use VERSION> construct. That is, | |
1411 | ||
02cf5fb7 | 1412 | use v5.36.0; |
69bcf1d3 FC |
1413 | |
1414 | will do an implicit | |
1415 | ||
39ec54a5 | 1416 | no feature ':all'; |
02cf5fb7 | 1417 | use feature ':5.36'; |
69bcf1d3 FC |
1418 | |
1419 | and so on. Note how the trailing sub-version | |
1420 | is automatically stripped from the | |
1421 | version. | |
1422 | ||
1423 | But to avoid portability warnings (see L<perlfunc/use>), you may prefer: | |
1424 | ||
02cf5fb7 | 1425 | use 5.036; |
69bcf1d3 FC |
1426 | |
1427 | with the same effect. | |
1428 | ||
1429 | If the required version is older than Perl 5.10, the ":default" feature | |
1430 | bundle is automatically loaded instead. | |
1431 | ||
affe54fa AC |
1432 | Unlike C<use feature ":5.12">, saying C<use v5.12> (or any higher version) |
1433 | also does the equivalent of C<use strict>; see L<perlfunc/use> for details. | |
1434 | ||
69bcf1d3 FC |
1435 | =back |
1436 | ||
7e18321c TC |
1437 | =head1 CHECKING FEATURES |
1438 | ||
1439 | C<feature> provides some simple APIs to check which features are enabled. | |
1440 | ||
1441 | These functions cannot be imported and must be called by their fully | |
1442 | qualified names. If you don't otherwise need to set a feature you will | |
1443 | need to ensure C<feature> is loaded with: | |
1444 | ||
1445 | use feature (); | |
1446 | ||
1447 | =over | |
1448 | ||
1449 | =item feature_enabled($feature) | |
1450 | ||
1451 | =item feature_enabled($feature, $depth) | |
1452 | ||
1453 | package MyStandardEnforcer; | |
1454 | use feature (); | |
1455 | use Carp "croak"; | |
1456 | sub import { | |
1457 | croak "disable indirect!" if feature::feature_enabled("indirect"); | |
1458 | } | |
1459 | ||
1460 | Test whether a named feature is enabled at a given level in the call | |
1461 | stack, returning a true value if it is. C<$depth> defaults to 1, | |
1462 | which checks the scope that called the scope calling | |
1463 | feature::feature_enabled(). | |
1464 | ||
1465 | croaks for an unknown feature name. | |
1466 | ||
1467 | =item features_enabled() | |
1468 | ||
1469 | =item features_enabled($depth) | |
1470 | ||
1471 | package ReportEnabledFeatures; | |
1472 | use feature "say"; | |
1473 | sub import { | |
1474 | say STDERR join " ", feature::features_enabled(); | |
1475 | } | |
1476 | ||
1477 | Returns a list of the features enabled at a given level in the call | |
1478 | stack. C<$depth> defaults to 1, which checks the scope that called | |
1479 | the scope calling feature::features_enabled(). | |
1480 | ||
1481 | =item feature_bundle() | |
1482 | ||
1483 | =item feature_bundle($depth) | |
1484 | ||
1485 | Returns the feature bundle, if any, selected at a given level in the | |
1486 | call stack. C<$depth> defaults to 1, which checks the scope that called | |
1487 | the scope calling feature::feature_bundle(). | |
1488 | ||
1489 | Returns an undefined value if no feature bundle is selected in the | |
1490 | scope. | |
1491 | ||
1492 | The bundle name returned will be for the earliest bundle matching the | |
1493 | selected bundle, so: | |
1494 | ||
1495 | use feature (); | |
1496 | use v5.12; | |
1497 | BEGIN { print feature::feature_bundle(0); } | |
1498 | ||
1499 | will print C<5.11>. | |
1500 | ||
1501 | This returns internal state, at this point C<use v5.12;> sets the | |
1502 | feature bundle, but C< use feature ":5.12"; > does not set the feature | |
1503 | bundle. This may change in a future release of perl. | |
1504 | ||
1505 | =back | |
1506 | ||
69bcf1d3 FC |
1507 | =cut |
1508 | ||
1509 | sub import { | |
22055af9 | 1510 | shift; |
36143a0c NC |
1511 | |
1512 | if (!@_) { | |
69bcf1d3 FC |
1513 | croak("No features specified"); |
1514 | } | |
36143a0c | 1515 | |
d3757264 | 1516 | __common(1, @_); |
69bcf1d3 FC |
1517 | } |
1518 | ||
1519 | sub unimport { | |
22055af9 | 1520 | shift; |
69bcf1d3 | 1521 | |
39ec54a5 | 1522 | # A bare C<no feature> should reset to the default bundle |
69bcf1d3 | 1523 | if (!@_) { |
39ec54a5 RS |
1524 | $^H &= ~($hint_uni8bit|$hint_mask); |
1525 | return; | |
69bcf1d3 FC |
1526 | } |
1527 | ||
d3757264 NC |
1528 | __common(0, @_); |
1529 | } | |
1530 | ||
1531 | ||
1532 | sub __common { | |
1533 | my $import = shift; | |
0c8d5017 NC |
1534 | my $bundle_number = $^H & $hint_mask; |
1535 | my $features = $bundle_number != $hint_mask | |
9f601cf3 | 1536 | && $feature_bundle{$hint_bundles[$bundle_number >> $hint_shift]}; |
0c8d5017 | 1537 | if ($features) { |
da5b5421 | 1538 | # Features are enabled implicitly via bundle hints. |
d9ee6ccb NC |
1539 | # Delete any keys that may be left over from last time. |
1540 | delete @^H{ values(%feature) }; | |
1541 | $^H |= $hint_mask; | |
1542 | for (@$features) { | |
1543 | $^H{$feature{$_}} = 1; | |
1544 | $^H |= $hint_uni8bit if $_ eq 'unicode_strings'; | |
1545 | } | |
da5b5421 | 1546 | } |
69bcf1d3 FC |
1547 | while (@_) { |
1548 | my $name = shift; | |
1549 | if (substr($name, 0, 1) eq ":") { | |
1550 | my $v = substr($name, 1); | |
1551 | if (!exists $feature_bundle{$v}) { | |
1552 | $v =~ s/^([0-9]+)\.([0-9]+).[0-9]+$/$1.$2/; | |
1553 | if (!exists $feature_bundle{$v}) { | |
1554 | unknown_feature_bundle(substr($name, 1)); | |
1555 | } | |
1556 | } | |
1557 | unshift @_, @{$feature_bundle{$v}}; | |
1558 | next; | |
1559 | } | |
36143a0c | 1560 | if (!exists $feature{$name}) { |
db629560 FC |
1561 | if (exists $noops{$name}) { |
1562 | next; | |
1563 | } | |
c22e17d0 DIM |
1564 | if (!$import && exists $removed{$name}) { |
1565 | next; | |
1566 | } | |
69bcf1d3 | 1567 | unknown_feature($name); |
69bcf1d3 | 1568 | } |
d3757264 NC |
1569 | if ($import) { |
1570 | $^H{$feature{$name}} = 1; | |
1571 | $^H |= $hint_uni8bit if $name eq 'unicode_strings'; | |
1572 | } else { | |
69bcf1d3 FC |
1573 | delete $^H{$feature{$name}}; |
1574 | $^H &= ~ $hint_uni8bit if $name eq 'unicode_strings'; | |
1575 | } | |
1576 | } | |
1577 | } | |
1578 | ||
1579 | sub unknown_feature { | |
1580 | my $feature = shift; | |
1581 | croak(sprintf('Feature "%s" is not supported by Perl %vd', | |
1582 | $feature, $^V)); | |
1583 | } | |
1584 | ||
1585 | sub unknown_feature_bundle { | |
1586 | my $feature = shift; | |
1587 | croak(sprintf('Feature bundle "%s" is not supported by Perl %vd', | |
1588 | $feature, $^V)); | |
1589 | } | |
1590 | ||
1591 | sub croak { | |
1592 | require Carp; | |
1593 | Carp::croak(@_); | |
1594 | } | |
1595 | ||
7e18321c TC |
1596 | sub features_enabled { |
1597 | my ($depth) = @_; | |
1598 | ||
1599 | $depth //= 1; | |
1600 | my @frame = caller($depth+1) | |
1601 | or return; | |
1602 | my ($hints, $hinthash) = @frame[8, 10]; | |
1603 | ||
1604 | my $bundle_number = $hints & $hint_mask; | |
1605 | if ($bundle_number != $hint_mask) { | |
1606 | return $feature_bundle{$hint_bundles[$bundle_number >> $hint_shift]}->@*; | |
1607 | } | |
1608 | else { | |
1609 | my @features; | |
1610 | for my $feature (sort keys %feature) { | |
1611 | if ($hinthash->{$feature{$feature}}) { | |
1612 | push @features, $feature; | |
1613 | } | |
1614 | } | |
1615 | return @features; | |
1616 | } | |
1617 | } | |
1618 | ||
1619 | sub feature_enabled { | |
1620 | my ($feature, $depth) = @_; | |
1621 | ||
1622 | $depth //= 1; | |
1623 | my @frame = caller($depth+1) | |
1624 | or return; | |
1625 | my ($hints, $hinthash) = @frame[8, 10]; | |
1626 | ||
1627 | my $hint_feature = $feature{$feature} | |
1628 | or croak "Unknown feature $feature"; | |
1629 | my $bundle_number = $hints & $hint_mask; | |
1630 | if ($bundle_number != $hint_mask) { | |
1631 | my $bundle = $hint_bundles[$bundle_number >> $hint_shift]; | |
1632 | for my $bundle_feature ($feature_bundle{$bundle}->@*) { | |
1633 | return 1 if $bundle_feature eq $feature; | |
1634 | } | |
1635 | return 0; | |
1636 | } | |
1637 | else { | |
1638 | return $hinthash->{$hint_feature} // 0; | |
1639 | } | |
1640 | } | |
1641 | ||
1642 | sub feature_bundle { | |
1643 | my $depth = shift; | |
1644 | ||
1645 | $depth //= 1; | |
1646 | my @frame = caller($depth+1) | |
1647 | or return; | |
1648 | my $bundle_number = $frame[8] & $hint_mask; | |
1649 | if ($bundle_number != $hint_mask) { | |
1650 | return $hint_bundles[$bundle_number >> $hint_shift]; | |
1651 | } | |
1652 | else { | |
1653 | return undef; | |
1654 | } | |
1655 | } | |
1656 | ||
69bcf1d3 | 1657 | 1; |