This is probably more overhead than you want, but using DBI with DBD::DBM (comes with DBI but you need to add SQL::Statement for richer SQL) you can treat your database as an, um, database, and use the LIKE operator to match the records you want with SQL. DBD::DBM can work with DB_File or with BerkeleyDb.
Comment on Re: DB_BTREE partial matches anywhwere in the key?
Thanks for the hint.
The point is, I'm trying to build a system using only core modules and DBM databases.
I've done similiar with flat files and with SQL.
It's sort of a challenge to find a reasonable way to go with DBM and core modules.
Thx again esp. for pointing to SQL::Statement - learned something new again.