for my $match (split //, $rows[$after]) {
scalar $link =~ /\G\Q$match/g or last;
$trim++;
}
# use this link if it's shorter
if ($trim < length $link) {
for my $match (split //, $rows[$after]) {
scalar $link =~ /\G\Q$match/g or last;
$trim++;
}
# use this link if it's shorter
if ($trim < length $link) {