Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop the 5 (implement PPC0025) #22857

Draft
wants to merge 18 commits into
base: blead
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Configure
Original file line number Diff line number Diff line change
Expand Up @@ -7118,16 +7118,16 @@ $echo "(You have $package $version_patchlevel_string.)"
case "$osname" in
dos|vms)
: XXX Should be a Configure test for double-dots in filenames.
version=`echo $revision $patchlevel $subversion | \
$awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
api_versionstring=`echo $api_revision $api_version $api_subversion | \
$awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
version=`echo $patchlevel $subversion | \
$awk '{ printf "%d_%d", $1, $2 }'`
api_versionstring=`echo $api_version $api_subversion | \
$awk '{ printf "%d_%d", $1, $2 }'`
;;
*)
version=`echo $revision $patchlevel $subversion | \
$awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
version=`echo $patchlevel $subversion | \
$awk '{ printf "%d.%d", $1, $2 }'`
api_versionstring=`echo $api_revision $api_version $api_subversion | \
$awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
$awk '{ printf "%d.%d", $1, $2 }'`
;;
esac
: Special case the 5.005_xx maintenance series, which used 5.005
Expand Down
3 changes: 1 addition & 2 deletions Porting/makerel
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@ my @patchlevel_h = <PATCHLEVEL>;
close PATCHLEVEL;
my $patchlevel_h = join "", grep { /^#\s*define/ } @patchlevel_h;
print $patchlevel_h;
my $revision = $1 if $patchlevel_h =~ /PERL_REVISION\s+(\d+)/;
my $patchlevel = $1 if $patchlevel_h =~ /PERL_VERSION\s+(\d+)/;
my $subversion = $1 if $patchlevel_h =~ /PERL_SUBVERSION\s+(\d+)/;
die "Unable to parse patchlevel.h" unless $subversion >= 0;
my $vers = sprintf("%d.%d.%d", $revision, $patchlevel, $subversion);
my $vers = sprintf("%d.%d", $patchlevel, $subversion);

# fetch list of local patches
my (@local_patches, @lpatch_tags, $lpatch_tags);
Expand Down
4 changes: 2 additions & 2 deletions cpan/CPAN-Meta-Requirements/t/from-hash.t
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ for my $string (10, '>= 2, <= 9, != 7') {

SKIP: {
skip "Can't tell v-strings from strings until 5.8.1", 1
unless $] gt '5.008';
unless "$]" > 5.008;
my $string_hash = {
Left => 10,
Shared => '= 2',
Expand Down Expand Up @@ -87,7 +87,7 @@ SKIP: {

SKIP: {
skip "Can't tell v-strings from strings until 5.8.1", 2
unless $] gt '5.008';
unless "$]" > 5.008;
my $string_hash = {
Left => 10,
Shared => v50.44.60,
Expand Down
2 changes: 1 addition & 1 deletion cpan/CPAN-Meta/lib/CPAN/Meta.pm
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ sub save {
my ($self, $file, $options) = @_;

my $version = $options->{version} || '2';
my $layer = $] ge '5.008001' ? ':utf8' : '';
my $layer = "$]" >= 5.008001 ? ':utf8' : '';

if ( $version ge '2' ) {
carp "'$file' should end in '.json'"
Expand Down
10 changes: 5 additions & 5 deletions cpan/HTTP-Tiny/lib/HTTP/Tiny.pm
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ sub _prepare_headers_and_cb {
}
elsif ( length $args->{content} ) {
my $content = $args->{content};
if ( $] ge '5.008' ) {
if ( "$]" >= 5.008 ) {
utf8::downgrade($content, 1)
or die(qq/Wide character in request message body\n/);
}
Expand Down Expand Up @@ -1032,7 +1032,7 @@ my $unsafe_char = qr/[^A-Za-z0-9\-\._~]/;
sub _uri_escape {
my ($self, $str) = @_;
return "" if !defined $str;
if ( $] ge '5.008' ) {
if ( "$]" >= 5.008 ) {
utf8::encode($str);
}
else {
Expand Down Expand Up @@ -1189,7 +1189,7 @@ sub write {
@_ == 2 || die(q/Usage: $handle->write(buf)/ . "\n");
my ($self, $buf) = @_;

if ( $] ge '5.008' ) {
if ( "$]" >= 5.008 ) {
utf8::downgrade($buf, 1)
or die(qq/Wide character in write()\n/);
}
Expand Down Expand Up @@ -1474,7 +1474,7 @@ sub write_content_body {
defined $data && length $data
or last;

if ( $] ge '5.008' ) {
if ( "$]" >= 5.008 ) {
utf8::downgrade($data, 1)
or die(qq/Wide character in write_content()\n/);
}
Expand Down Expand Up @@ -1521,7 +1521,7 @@ sub write_chunked_body {
defined $data && length $data
or last;

if ( $] ge '5.008' ) {
if ( "$]" >= 5.008 ) {
utf8::downgrade($data, 1)
or die(qq/Wide character in write_chunked_body()\n/);
}
Expand Down
8 changes: 4 additions & 4 deletions cpan/Pod-Simple/lib/Pod/Simple.pm
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ BEGIN {
die "MANY_LINES is too small (", MANY_LINES(), ")!\nAborting";
}
if(defined &UNICODE) { }
elsif($] >= 5.008) { *UNICODE = sub() {1} }
else { *UNICODE = sub() {''} }
elsif( do { no integer; "$]" >= 5.008 } ) { *UNICODE = sub() {1} }
else { *UNICODE = sub() {''} }
}
if(DEBUG > 2) {
print STDERR "# We are ", ASCII ? '' : 'not ', "in ASCII-land\n";
print STDERR "# We are under a Unicode-safe Perl.\n";
}

# The NO BREAK SPACE and SOFT HYHPEN are used in several submodules.
if ($] ge 5.007_003) { # On sufficiently modern Perls we can handle any
# character set
if ( do { no integer; "$]" >= 5.007_003 } ) { # On sufficiently modern Perls we can handle any
# character set
$Pod::Simple::nbsp = chr utf8::unicode_to_native(0xA0);
$Pod::Simple::shy = chr utf8::unicode_to_native(0xAD);
}
Expand Down
10 changes: 5 additions & 5 deletions cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ sub my_qr ($$) {
my ($input_re, $should_match) = @_;
# XXX could have a third parameter $shouldnt_match for extra safety

my $use_utf8 = ($] le 5.006002) ? 'use utf8;' : "";
my $use_utf8 = do { no integer; $] <= 5.006002 } ? 'use utf8;' : "";

my $re = eval "no warnings; $use_utf8 qr/$input_re/";
#print STDERR __LINE__, ": $input_re: $@\n" if $@;
Expand Down Expand Up @@ -93,7 +93,7 @@ my $deprecated_re = my_qr('\p{IsDeprecated}', "\x{149}");
$deprecated_re = qr/\x{149}/ unless $deprecated_re;

my $utf8_bom;
if (($] ge 5.007_003)) {
if ( do { no integer; "$]" >= 5.007_003 }) {
$utf8_bom = "\x{FEFF}";
utf8::encode($utf8_bom);
} else {
Expand Down Expand Up @@ -266,13 +266,13 @@ sub parse_lines { # Usage: $parser->parse_lines(@lines)
# XXX probably if the line has E<foo> that evaluates to illegal CP1252,
# then it is UTF-8. But we haven't processed E<> yet.

goto set_1252 if $] lt 5.006_000; # No UTF-8 on very early perls
goto set_1252 if do { no integer; "$]" < 5.006_000 }; # No UTF-8 on very early perls

my $copy;

no warnings 'utf8';

if ($] ge 5.007_003) {
if ( do { no integer; "$]" >= 5.007_003 } ) {
$copy = $line;

# On perls that have this function, we can use it to easily see if the
Expand All @@ -286,7 +286,7 @@ sub parse_lines { # Usage: $parser->parse_lines(@lines)
}
else { # ASCII, no decode(): do it ourselves using the fundamental
# characteristics of UTF-8
use if $] le 5.006002, 'utf8';
use if do { no integer; "$]" <= 5.006002 }, 'utf8';

my $char_ord;
my $needed; # How many continuation bytes to gobble up
Expand Down
2 changes: 1 addition & 1 deletion cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ sub _handle_element_end {
sub _xml_escape {
foreach my $x (@_) {
# Escape things very cautiously:
if ($] ge 5.007_003) {
if ("$]" >= 5.007_003) {
$x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/'&#'.(utf8::native_to_unicode(ord($1))).';'/eg;
} else { # Is broken for non-ASCII platforms on early perls
$x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/'&#'.(ord($1)).';'/eg;
Expand Down
8 changes: 4 additions & 4 deletions cpan/Pod-Simple/lib/Pod/Simple/HTML.pm
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ sub section_name_tidy {
$section =~ s/^\s+//;
$section =~ s/\s+$//;
$section =~ tr/ /_/;
if ($] ge 5.006) {
if ("$]" >= 5.006) {
$section =~ s/[[:cntrl:][:^ascii:]]//g; # drop crazy characters
} elsif ('A' eq chr(65)) { # But not on early EBCDIC
$section =~ tr/\x00-\x1F\x80-\x9F//d;
Expand All @@ -724,7 +724,7 @@ sub general_url_escape {
# A pretty conservative escaping, behoovey even for query components
# of a URL (see RFC 2396)

if ($] ge 5.007_003) {
if ("$]" >= 5.007_003) {
$string =~ s/([^-_\.!~*()abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/sprintf('%%%02X',utf8::native_to_unicode(ord($1)))/eg;
} else { # Is broken for non-ASCII platforms on early perls
$string =~ s/([^-_\.!~*()abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/sprintf('%%%02X',ord($1))/eg;
Expand Down Expand Up @@ -862,7 +862,7 @@ sub esc { # a function.
@_ = splice @_; # break aliasing
} else {
my $x = shift;
if ($] ge 5.007_003) {
if ("$]" >= 5.007_003) {
$x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/'&#'.(utf8::native_to_unicode(ord($1))).';'/eg;
} else { # Is broken for non-ASCII platforms on early perls
$x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/'&#'.(ord($1)).';'/eg;
Expand All @@ -873,7 +873,7 @@ sub esc { # a function.
foreach my $x (@_) {
# Escape things very cautiously:
if (defined $x) {
if ($] ge 5.007_003) {
if ("$]" >= 5.007_003) {
$x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/'&#'.(utf8::native_to_unicode(ord($1))).';'/eg
} else { # Is broken for non-ASCII platforms on early perls
$x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/'&#'.(ord($1)).';'/eg
Expand Down
4 changes: 2 additions & 2 deletions cpan/Pod-Simple/lib/Pod/Simple/RTF.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ sub to_uni ($) { # Convert native code point to Unicode
my $x = shift;

# Broken for early EBCDICs
$x = chr utf8::native_to_unicode(ord $x) if $] ge 5.007_003
$x = chr utf8::native_to_unicode(ord $x) if "$]" >= 5.007_003
&& ord("A") != 65;
return $x;
}
Expand Down Expand Up @@ -549,7 +549,7 @@ my $other_unicode =
Pod::Simple::BlackBox::my_qr('([\x{10000}-\x{10FFFF}])', "\x{10000}");

sub esc_uni($) {
use if $] le 5.006002, 'utf8';
use if do { no integer; "$]" <= 5.006002 }, 'utf8';

my $x = shift;

Expand Down
2 changes: 1 addition & 1 deletion cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ sub _handle_element_end {
sub _xml_escape {
foreach my $x (@_) {
# Escape things very cautiously:
if ($] ge 5.007_003) {
if ("$]" >= 5.007_003) {
$x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/'&#'.(utf8::native_to_unicode(ord($1))).';'/eg;
} else { # Is broken for non-ASCII platforms on early perls
$x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/'&#'.(ord($1)).';'/eg;
Expand Down
2 changes: 1 addition & 1 deletion cpan/Pod-Simple/t/ascii_order.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ($)
my $string = shift;

return $string if ord("A") == 65
|| $] lt 5.007_003; # Doesn't work on early EBCDIC Perls
|| "$]" < 5.007_003; # Doesn't work on early EBCDIC Perls
my $output = "";
for my $i (0 .. length($string) - 1) {
$output .= chr(utf8::native_to_unicode(ord(substr($string, $i, 1))));
Expand Down
2 changes: 1 addition & 1 deletion cpan/Pod-Simple/t/encod04.t
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use Pod::Simple::XMLOutStream;
my $x97;
my $x91;
my $dash;
if ($] ge 5.007_003) {
if ("$]" >= 5.007_003) {
$x97 = chr utf8::unicode_to_native(0x97);
$x91 = chr utf8::unicode_to_native(0x91);
$dash = '&#8212';
Expand Down
2 changes: 1 addition & 1 deletion cpan/Scalar-List-Utils/t/stack-corruption.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!./perl

BEGIN {
if ($] eq "5.008009" or $] eq "5.010000" or $] le "5.006002") {
if ("$]" == 5.008009 or "$]" == 5.010000 or "$]" <= 5.006002) {
print "1..0 # Skip: known to fail on $]\n";
exit 0;
}
Expand Down
2 changes: 1 addition & 1 deletion cpan/Scalar-List-Utils/t/sum.t
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ SKIP: {
cmp_ok($t, 'gt', 1152921504606846976, 'sum uses IV where it can'); # string comparison because Perl 5.6 does not compare it numerically correctly

SKIP: {
skip "known to fail on $]", 1 if $] le "5.006002";
skip "known to fail on $]", 1 if "$]" <= 5.006002;
$t = sum(1<<60, 1);
cmp_ok($t, '>', 1<<60, 'sum uses IV where it can');
}
Expand Down
6 changes: 3 additions & 3 deletions cpan/Scalar-List-Utils/t/uniq.t
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ is_deeply( [ uniqstr qw( 1 1.0 1E0 ) ],
}

SKIP: {
skip 'Perl 5.007003 with utf8::encode is required', 3 if $] lt "5.007003";
skip 'Perl 5.007003 with utf8::encode is required', 3 if "$]" < 5.007003;
my $warnings = "";
local $SIG{__WARN__} = sub { $warnings .= join "", @_ };

Expand Down Expand Up @@ -99,7 +99,7 @@ is_deeply( [ uniqint 6.1, 6.2, 6.3 ],
}

SKIP: {
skip('UVs are not reliable on this perl version', 2) unless $] ge "5.008000";
skip('UVs are not reliable on this perl version', 2) unless "$]" >= 5.008000;

my $maxbits = $Config{ivsize} * 8 - 1;

Expand Down Expand Up @@ -153,7 +153,7 @@ is( scalar( uniqstr qw( a b c d a b e ) ), 5, 'uniqstr() in scalar context' );
}

SKIP: {
skip('int overload requires perl version 5.8.0', 1) unless $] ge "5.008000";
skip('int overload requires perl version 5.8.0', 1) unless "$]" >= 5.008000;

package Googol;

Expand Down
2 changes: 1 addition & 1 deletion cpan/Scalar-List-Utils/t/uniqnum.t
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ SKIP: {
# uniqnum not confused by IV'ified floats
SKIP: {
# This fails on 5.6 and isn't fixable without breaking a lot of other tests
skip 'This perl version gets confused by IVNV dualvars', 1 if $] lt '5.008000';
skip 'This perl version gets confused by IVNV dualvars', 1 if "$]" <= 5.008000;
my @nums = ( 2.1, 2.2, 2.3 );
my $dummy = sprintf "%d", $_ for @nums;

Expand Down
2 changes: 1 addition & 1 deletion cpan/Test-Harness/lib/TAP/Harness.pm
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ Any keys for which the value is C<undef> will be ignored.
warn "CPAN::Meta::YAML required to process $rulesfile" ;
return;
}
my $layer = $] lt "5.008" ? "" : ":encoding(UTF-8)";
my $layer = "$]" < 5.008 ? "" : ":encoding(UTF-8)";
open my $fh, "<$layer", $rulesfile
or die "Couldn't open $rulesfile: $!";
my $yaml_text = do { local $/; <$fh> };
Expand Down
2 changes: 1 addition & 1 deletion cpan/version/t/coretests.pm
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ SKIP: {

SKIP: {
skip 'Cannot test bare alpha v-strings with Perl < 5.8.1', 2
if $] lt 5.008_001;
if "$]" < 5.008_001;
$version = $CLASS->$method(v1.2.3_4);
$DB::single = 1;
is($version, "v1.2.34", '"$version" eq "v1.2.34"');
Expand Down
Loading
Loading