Skip to content

Instantly share code, notes, and snippets.

@briandfoy
Created May 31, 2022 22:48
Show Gist options
  • Save briandfoy/0aebbe60165c5cc62a43613092275f7e to your computer and use it in GitHub Desktop.
Save briandfoy/0aebbe60165c5cc62a43613092275f7e to your computer and use it in GitHub Desktop.
(Perl) What feature is what version?
#!perl
use v5.36;
use feature ();
my( %Features, %Versions );
foreach my $key ( keys %feature::feature_bundle ) {
next unless $key =~ /\A5\.\d[02468]\z/;
$Versions{$key}++;
foreach my $feature ( $feature::feature_bundle{$key}->@* ) {
$Features{$feature}{$key}++;
}
}
my( $Longest_length ) =
sort { $b <=> $a }
map { length } keys %Features;
my $template = "%-${Longest_length}s " .
join( ' ', ('%-4s') x %Versions) . "\n";
my $header =
sprintf $template, "Feature",
sort keys %Versions;
print $header;
say join '', qw(-) x length $header;
foreach my $feature ( sort keys %Features ) {
my @ticks = map { $Features{$feature}{$_} ? ' *' : '' }
sort keys %Versions;
printf $template, $feature, @ticks;
}
Feature 5.10 5.12 5.14 5.16 5.18 5.20 5.22 5.24 5.26 5.28 5.30 5.32 5.34 5.36
--------------------------------------------------------------------------------------------------------
bareword_filehandles * * * * * * * * * * * * * *
bitwise * * * * *
current_sub * * * * * * * * * * *
evalbytes * * * * * * * * * * *
fc * * * * * * * * * * *
indirect * * * * * * * * * * * * *
isa *
multidimensional * * * * * * * * * * * * *
postderef_qq * * * * * * *
say * * * * * * * * * * * * * *
signatures *
state * * * * * * * * * * * * * *
switch * * * * * * * * * * * * *
unicode_eval * * * * * * * * * * *
unicode_strings * * * * * * * * * * * * *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment