I noticed these dependencies in perl-Path-Tiny-0.144-5.fc40: # For performance and consistency %if !(0%{?rhel}) BuildRequires: perl(PerlIO::utf8_strict) >= 0.003 Requires: perl(PerlIO::utf8_strict) >= 0.003 %endif BuildRequires: perl(Unicode::UTF8) >= 0.58 Requires: perl(Unicode::UTF8) >= 0.58 In other words, this package build- and run-requires both perl(PerlIO::utf8_strict) and perl(Unicode::UTF8) on Fedora. However a code in lib/Path/Tiny.pm never uses both of the modules: my $HAS_UU; # has Unicode::UTF8; lazily populated sub _check_UU { local $SIG{__DIE__}; # prevent outer handler from being called !!eval { require Unicode::UTF8; Unicode::UTF8->VERSION(0.58); 1; }; } my $HAS_PU; # has PerlIO::utf8_strict; lazily populated sub _check_PU { local $SIG{__DIE__}; # prevent outer handler from being called !!eval { # MUST preload Encode or $SIG{__DIE__} localization fails # on some Perl 5.8.8 (maybe other 5.8.*) compiled with -O2. require Encode; require PerlIO::utf8_strict; PerlIO::utf8_strict->VERSION(0.003); 1; }; } [...] if ( ( defined($HAS_UU) ? $HAS_UU : ( $HAS_UU = _check_UU() ) ) && $args->{chomp} && !$args->{count} ) { my $slurp = slurp_utf8($self); $slurp =~ s/$CRLF\z//; # like chomp, but full CR?LF|CR return split $CRLF, $slurp, -1; ## no critic } elsif ( defined($HAS_PU) ? $HAS_PU : ( $HAS_PU = _check_PU() ) ) { $args->{binmode} = ":raw:utf8_strict"; return lines( $self, $args ); } else { $args->{binmode} = ":raw:encoding(UTF-8)"; return lines( $self, $args ); } I recommend removing the never used dependency on perl(PerlIO::utf8_strict). Please note that the tests attempts to exhibit both code paths by masking the other module. However, performing the tests in Fedora is dubious if we never use PerlIO::utf8_strict if Unicode::UTF8 is available at run-time.
You are right that append_utf8 uses Unicode::UTF8 in preference to PerlIO::utf8_strict. However, in edit_lines_utf8 and open*_utf8, PerlIO::utf8_strict is used if available and there is no optimized version using Unicode::UTF8: sub edit_lines_utf8 { if ( defined($HAS_PU) ? $HAS_PU : ( $HAS_PU = _check_PU() ) ) { $_[2] = { binmode => ":raw:utf8_strict" }; } else { $_[2] = { binmode => ":raw:encoding(UTF-8)" }; } goto &edit_lines; } So I think it's not right to say that PerlIO::utf8_strict is never used in the presence of Unicode::UTF8.
You are right. That's silly.