in reply to Partial Searches Against Multiple Wildcards

Do you have any suggestions for perl-ish ways to tackle this?

My first thought is not to use Perl to do this, as you have said you are using a database.

Substitute the * wildcard characters for _ SQL wildcard characters and feed that directly into your SQL query.

my $search = 'D7*D'; $search =~ /*/_/g; my ($id, $new) = $dbh->selectrow_array("SELECT rowid, new FROM table W +HERE old LIKE ?", undef, $search);

(untested)

Replies are listed 'Best First'.
Re^2: Partial Searches Against Multiple Wildcards
by LanX (Saint) on Dec 18, 2023 at 21:41 UTC

      Ah yes!
      Re-reading it - perhaps I did...