If anyone knows other ways, welcome to post as a comment.
my $email = 'firstname.lastname@example.org';
my ($id, $domain) = $email =~ /(.*)\@(.*)/g;
Thursday, May 15, 2008
Grab User and domain name from email address
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.
This little piece of code will help you to get the function name programatically. This is very helpful when you are implementing the debug...
Many other programming languages, Python does have the comparator facility to sort a list according to your need. You can define a customize...
Actually there is no specific variable existence like string, integer, etc at Perl. All are called Scalar, and it takes all at the same time...