in reply to Fast sublist generation
if(index($key, $combine) != -1) { print "Found (prefix $combine): $1\n"; } [download]
It should be more efficient than compiling and executing a regexp. For the suffix code you could combine index and length.