# if this all is in the variable $message.. and # all your messages are the same..you can do my ($name, $email) = $message =~ /^From:\s+\"(.*)\"\s+\<(.*)\>$/m; # and you get the name and the e-mail..