Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use strict;
- use warnings;
- use utf8;
- use open qw(:encoding(utf8) :std);
- use feature 'say';
- my @address = qw(aaa@test.local aaa.bbb@test.local hoge@test.local ccc@test.jp);
- foreach (@address) {
- my ($name, $domain) = split '@';
- if ($domain !~ /\Atest\.local\z/) { say; next; }
- if ($domain =~ /\Atest\.local\z/) {
- if ($name =~ /\Ahoge\z/) { say; next; }
- if ($name =~ /\./) { say; next; }
- }
- say $_ , " invalid";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement