From Address(s) - Needed to verify the sender to continue in the script next steps..
You can use index to locate a fixed substring (such as "From: firstname.lastname@example.org\n") in a longer one.
need to confirm that the To address contains 8 numbers @domain.com
A regular expression could do that. See the tutorial for getting started.
I need remove the @domain.com and the number into a temp $mobilvariable and the subject into another $textvariable.
More regular expressions this time with capture groups.
Sounds like you have an algorithm planned and just now need to turn it into working code. Good luck.
(BTW, you posted this in the wrong section (Perl Monks Discussion). I've moved it to Seekers of Perl Wisdom where it belongs.)