in reply to Parse::RecDescent question

Overkill. Wouldn't something like:
$system = "LMN" if $sender eq 'abc' or $domain eq 'xyz' or $message =~ + /DEF/;
do? If your real question is "how to get the headers out of an email", use one of the gazillion e?mail related CPAN modules,