The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
sub t {
    my ($a, $b) = @_;
    my ($wa, $wb, $db);

    my $not = 0;

    foreach (@$a) { chomp }
    foreach (@$b) { chomp }

    my @oa = @$a;
    my @ob = @$b;

    if (@$a == @$b) {
	for $wa (@$a) {
	    $wb = shift(@$b);
	    $db = defined $wb;
	    if ($db) {
	        $wa =~ s/^\s+//;
	        $wa =~ s/\s+$//;
	        $wb =~ s/^\s+//;
	        $wb =~ s/\s+$//;
	        $wa =~ s/\n//g;
	        $wb =~ s/\n//g;
	    }
	    if (not $db or $wa ne $wb) {
		print STDERR "# ne: $wa $wb\n";
		print 'not ';
		$not = 1;
		last;
	    }
	}
    } else {
	print STDERR "# !=: ", scalar @$a, " ", scalar @$b, "\n";
	print 'not ';
	$not = 1;
    }
    if ($not) {
	print STDERR "# EXPECTED: @oa\n";
	print STDERR "# GOT:      @ob\n";
    }
}

1;