Sisimai::Address(3pm)
π Sisimai::Address π
okay bestie, welcome to Sisimai::Address(3pm) β the cutest little email address object in all of Perl. It's part of the user-contributed Perl docs situation, and honestly? It ate. π
β¨ NAME β¨
Sisimai::Address β Email address object. That's it, that's the whole vibe. It's an object for dealing with email addresses. π
πΈ SYNOPSIS πΈ
here's the whole thing in action, look at her go:
use Sisimai::Address;
my $v = Sisimai::Address->new({ 'address' => 'neko@example.org' });
print $v->user; # neko
print $v->host; # example.org
print $v->address; # neko@example.org
print Sisimai::Address->is_emailaddress('neko@example.jp'); # 1
print Sisimai::Address->is_domainpart('example.jp'); # 1
print Sisimai::Address->is_mailerdaemon('neko@example.jp'); # 0
like. she does everything. she checks, she parses, she splits. main character energy fr fr. π¦
π DESCRIPTION π
Sisimai::Address provides methods for dealing with email addresses. That's the job. She deals with them. Respectfully. β¨
π CLASS METHODS π
π is_emailaddress(email address)
is_emailaddress() method checks whether the argument is a valid email address or not. vibe check on the address, basically. π
print Sisimai::Address->is_emailaddress('neko@example.jp'); # 1
print Sisimai::Address->is_emailaddress('neko%example.jp'); # 0
my $addr_with_name = [
'Stray cat <neko@example.jp',
'=?UTF-8?B?55m954yr?= <shironeko@example.co.jp>',
];
for my $e ( @$addr_with_name ) {
print Sisimai::Address->is_emailaddress($e); # 1
}
yes bestie, she handles the "Name <addr>" situation AND the encoded-word display name situation. she's not scared. π
π is_quotedaddress(email address)
is_quotedaddress() method returns 1 if an argument is like "neko@nyaan"@example.jp β you know, the quoted-local-part situation, the one that makes people go π. so specific. so iconic. π
print Sisimai::Address->is_quotedaddress('"neko@nyaan"@example.jp'); # 1
print Sisimai::Address->is_quotedaddress('neko-nyaan@example.org'); # 0
π is_mailerdaemon(email address)
is_mailerdaemon() method checks whether the argument is mailer-daemon or not. is this the robot that yells at you when delivery fails? let's find out π«Ά
print Sisimai::Address->is_mailerdaemon('neko@example.jp'); # 0
print Sisimai::Address->is_mailerdaemon('mailer-daemon@example.jp'); # 1
π find(String)
find() method is a new parser for getting only the email address from the given string including email addresses. like, you hand her a whole messy paragraph and she pulls the addresses out one by one. obsessed. π
my $r = 'Stray cat <cat@example.org>, nyaa@example.org (White Cat)',
my $v = Sisimai::Address->find($r);
warn Dumper $v;
$VAR1 = [
{
'name' => 'Stray cat',
'address' => 'cat@example.org',
'comment' => ''
},
{
'name' => '',
'address' => 'nyaa@example.jp',
'comment' => '(White Cat)'
}
];
π s3s4(email address)
s3s4() method works Ruleset 3, and 4 of sendmail.cf. yeah. the sendmail rules. she's culturally literate, she read the classics. π
my $r = [
'Stray cat <cat@example.org>',
'nyaa@example.org (White Cat)',
];
for my $e ( @$r ) {
print Sisimai::Address->s3s4($e); # cat@example.org
# nyaa@example.org
}
π expand_verp(email address)
expand_verp() method gets the original email address from "VERP". unpacks the whole thing. reverse uno card moment. π
my $r = 'nyaa+neko=example.org@example.org';
print Sisimai::Address->expand_verp($r); # neko@example.org
π expand_alias(email address)
expand_alias() method gets the original email address from the alias address. same energy, different flavor. β¨
my $r = 'nyaa+neko@example.org';
print Sisimai::Address->expand_alias($r); # nyaa@example.org
π¦ INSTANCE METHODS π¦
β user()
user() method returns a local part of the email address. just the local part. just the before-the-@. π₯
my $v = Sisimai::Address->new({ 'address' => 'neko@example.org' });
print $v->user; # neko
β host()
host() method returns a domain part of the email address. the after-the-@ bit. the part where the cats live. π
my $v = Sisimai::Address->new({ 'address' => 'neko@example.org' });
print $v->host; # example.org
β address()
address() method returns an email address. the whole thing. the full package. periodt. π
my $v = Sisimai::Address->new({ 'address' => 'neko@example.org' });
print $v->address; # neko@example.org
β verp()
verp() method returns a VERP email address. π
my $v = Sisimai::Address->new({ 'address' => 'neko+nyaan=example.org@example.org' });
print $v->verp; # neko+nyaan=example.org@example.org
print $v->address; # nyaan@example.org
β alias()
alias() method returns an email address (alias). yes ma'am π«Ά
my $v = Sisimai::Address->new({ 'address' => 'neko+nyaan@example.org' });
print $v->alias; # neko+nyaan@example.org
print $v->address; # neko@example.org
β name()
name() method returns a display name. the pretty part before the angle brackets. the glow-up. β¨
my $e = '"Neko, Nyaan" <neko@example.org>';
my $r = Sisimai::Address->find($e);
my $v = Sisimai::Address->new($r->[0]);
print $v->address; # neko@example.org
print $v->name; # Neko, Nyaan
β comment()
comment() method returns a comment. the lil parenthetical. the side quest. π
my $e = '"Neko, Nyaan" <neko(nyaan)@example.org>';
my $v = Sisimai::Address->new(shift Sisimai::Address->find($e)->@*);
print $v->address; # neko@example.org
print $v->comment; # nyaan
π AUTHOR π
azumakuniyuki β the icon who built this. thank you for your service. π
π COPYRIGHT π
Copyright (C) 2014-2025 azumakuniyuki, All rights reserved.
π LICENSE π
This software is distributed under The BSD 2-Clause License.
okay so that's the whole page bestie, you're fully caught up, no cap. π§
this gorgeous lil manpage is served fresh from perl v5.40.1, dated 2026-07-05, and it lives under the name Sisimai::Address(3pm). go forth and parse some addresses, queen. πβ¨πΈ
π¦ where this page comes from
- ubuntu stonking: libsisimai-perl 5.7.0-1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms