don't have to add much, but if it's a "standard compliant" mail message: RFC 2822 seems to state the "Subject:" and other keywords are case-INsensitive, so you should match /From:/i and /Subject:/i, respectively. Email::Simple, as recommended by Athanasius, does already provide for this and other tiny quirks.