How to grab the user id and the domain name from the email address? There are many ways to do this. I'm giving an example of using Perl and regular expression.
If anyone knows other ways, welcome to post as a comment.
my $email = 'firstname.lastname@example.org';
my ($id, $domain) = $email =~ /(.*)\@(.*)/g;