You might want to modify the respective test to figure out what ls and Perl disagree on, e.g.
my $try = sub { # line 287
my @c1 = eval qq[\$DEV =~ /^$_[0].*/mg];
my @c2 = eval qq[grep { $_[1] "/dev/\$_" } \@DEV];
### add this
if ($_[1] eq "-c") {
my @c = map { /(\S+)$/; $1 } @c1;
my %diff;
@diff{@c} = ();
delete @diff{@c2};
print "!!: $_\n" for keys %diff;
exit;
}
###
my $c1 = scalar @c1;
my $c2 = scalar @c2;
is($c1, $c2, "ls and $_[1] agreeing on /dev ($c1 $c2)");
};
and then contemplate on who is right with respect to whether the reported entry is a "character special" file.