Sisimai::Address - Email address object
use Sisimai::Address; my $v = Sisimai::Address->new( 'neko@example.jp' ); print $v->user; # neko print $v->host; # example.jp print $v->address; # neko@example.jp
Sisimai::Address provide methods for dealing email address.
new( email address )
new() is a constructor of Sisimai::Address
new()
my $v = Sisimai::Address->new( 'neko@example.jp' );
parse( Array-Ref )
parse() is a parser for getting only email address from text including email addresses.
parse()
my $r = [ 'Stray cat <cat@example.jp>', 'nyaa@example.jp (White Cat)', ]; my $v = Sisimai::Address->parse( $r ); warn Dumper $v; $VAR1 = [ 'cat@example.jp', 'nyaa@example.jp' ];
s3s4( email address )
s3s4() works Ruleset 3, and 4 of sendmail.cf.
s3s4()
my $r = [ 'Stray cat <cat@example.jp>', 'nyaa@example.jp (White Cat)', ]; for my $e ( @$r ) { print Sisimai::Address->s3s4( $e ); # cat@example.jp # nyaa@example.jp }
expand_verp( email address )
expand_verp() gets the original email address from VERP
expand_verp()
my $r = 'nyaa+neko=example.jp@example.org'; print Sisimai::Address->expand_verp( $r ); # neko@example.jp
expand_alias( email address )
expand_alias() gets the original email address from alias
expand_alias()
my $r = 'nyaa+neko@example.jp'; print Sisimai::Address->expand_alias( $r ); # nyaa@example.jp
user()
user() returns a local part of the email address.
my $v = Sisimai::Address->new( 'neko@example.jp' ); print $v->user; # neko
host()
host() returns a domain part of the email address.
my $v = Sisimai::Address->new( 'neko@example.jp' ); print $v->host; # example.jp
address()
address() returns the email address
my $v = Sisimai::Address->new( 'neko@example.jp' ); print $v->address; # neko@example.jp
verp()
verp() returns the VERP email address
my $v = Sisimai::Address->new( 'neko+nyaa=example.jp@example.org' ); print $v->verp; # neko+nyaa=example.jp@example.org print $v->address; # nyaa@example.jp
alias()
alias() returns the email address (alias)
my $v = Sisimai::Address->new( 'neko+nyaa@example.jp' ); print $v->alias; # neko+nyaa@example.jp print $v->address; # neko@example.jp
azumakuniyuki
Copyright (C) 2014 azumakuniyuki <perl.org@azumakuniyuki.org>, All Rights Reserved.
This software is distributed under The BSD 2-Clause License.
To install Sisimai, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sisimai
CPAN shell
perl -MCPAN -e shell install Sisimai
For more information on module installation, please visit the detailed CPAN module installation guide.