Skip to content

Commit

Permalink
Merge pull request #120 from JRaspass/remove-5.6-hacks
Browse files Browse the repository at this point in the history
Remove obsolete perl 5.6 hacks
  • Loading branch information
Tux authored Aug 14, 2024
2 parents dbc1c48 + 4f95f9a commit 6249f40
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 18 deletions.
9 changes: 0 additions & 9 deletions DBI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1133,10 +1133,6 @@ sub data_string_diff {
if !defined $b;
}

require utf8;
# hack to cater for perl 5.6
*utf8::is_utf8 = sub { (DBI::neat(shift)=~/^"/) } unless defined &utf8::is_utf8;

my @a_chars = (utf8::is_utf8($a)) ? unpack("U*", $a) : unpack("C*", $a);
my @b_chars = (utf8::is_utf8($b)) ? unpack("U*", $b) : unpack("C*", $b);
my $i = 0;
Expand Down Expand Up @@ -1166,11 +1162,6 @@ sub data_string_diff {
sub data_string_desc { # describe a data string
my ($a) = @_;
require bytes;
require utf8;

# hacks to cater for perl 5.6
*utf8::is_utf8 = sub { (DBI::neat(shift)=~/^"/) } unless defined &utf8::is_utf8;
*utf8::valid = sub { 1 } unless defined &utf8::valid;

# Give sufficient info to help diagnose at least these kinds of situations:
# - valid UTF8 byte sequence but UTF8 flag not set
Expand Down
1 change: 0 additions & 1 deletion lib/DBI/ProxyServer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
##############################################################################


require 5.004;
use strict;
use warnings;

Expand Down
7 changes: 0 additions & 7 deletions lib/DBI/PurePerl.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ use warnings;
use Carp;
require Symbol;

require utf8;
*utf8::is_utf8 = sub { # hack for perl 5.6
require bytes;
return unless defined $_[0];
return !(length($_[0]) == bytes::length($_[0]))
} unless defined &utf8::is_utf8;

$DBI::PurePerl = $ENV{DBI_PUREPERL} || 1;
$DBI::PurePerl::VERSION = "2.014286";

Expand Down
1 change: 0 additions & 1 deletion t/80proxy.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# -*- perl -*-
# vim:sw=4:ts=8

require 5.004;
use strict;
use warnings;

Expand Down

0 comments on commit 6249f40

Please sign in to comment.