in reply to Creating regex from arrays

Further to the answers above there's presuf from the Regex::PreSuf module which is tailored specifically to solving this problem e.g
use Regex::PreSuf; print presuf("1234", "ABCD", "HIGL", "TOOA", "COOLIE"); __output__ (?:1234|ABCD|COOLIE|HIGL|TOOA)
It also rather niftily 'optimizes' (or 'compresses', depending on your view) the regular expression for overlapping words. See. the Regex::PreSuf docs for more info.
HTH

_________
broquaint