in reply to Matching in the Database...

Don't know if my idea fits your data. Maybe it helps anyway after tweaking.

$userinput =~ s/[^a-z]+/,/gi; # replace anything but a-z by comma my $q = "SELECT * FROM <table> WHERE <column> IN ($userinput)";