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 (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