jfrm has asked for the wisdom of the Perl Monks concerning the following question:
Oh peaceful ones, I have an array @titles = qw/Mr Mrs Ms Miss Dr Sir Lord Lady Rev/; To avoid the darkness of repetition and exult the glory of elegance, I would like to use it in the following regexp instead of retyping all the array elements: $text =~ /^(Mr|Mrs|Ms|Miss|Sir|Lord|Lady|Dr|Rev)\s+(.*)/) Please can anyone empower me with the knowledge?
Back to
Seekers of Perl Wisdom