The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Sisimai::Data - Parsed data object

SYNOPSIS

    use Sisimai::Data;
    my $data = Sisimai::Data->make( 'data' => <Sisimai::Message> object );
    for my $e ( @$data ) {
        print $e->reason;               # userunknown, mailboxfull, and so on.
        print $e->recipient->address;   # (Sisimai::Address) envelope recipient address
        print $e->bonced->ymd           # (Time::Piece) Date of bounce
    }

DESCRIPTION

Sisimai::Data generate parsed data from Sisimai::Message object.

CLASS METHODS

make( Hash )

make generate parsed data and returns an array reference which are including Sisimai::Data objects.

    my $mail = Sisimai::Mail->new('/var/mail/root');
    while( my $r = $mail->read ) {
        my $mesg = Sisimai::Message->new( 'data' => $r );
        my $data = Sisimai::Data->make( 'data' => $mesg );
        for my $e ( @$data ) {
            print $e->reason;               # userunknown, mailboxfull, and so on.
            print $e->recipient->address;   # (Sisimai::Address) envelope recipient address
            print $e->bonced->ymd           # (Time::Piece) Date of bounce
        }
    }

INSTANCE METHODS

damn()

damn convert the object to a hash reference.

    my $hash = $self->damn;
    print $hash->{'recipient'}; # user@example.jp
    print $hash->{'date'};      # 1393940000

AUTHOR

azumakuniyuki

COPYRIGHT

Copyright (C) 2014 azumakuniyuki <perl.org@azumakuniyuki.org>, All Rights Reserved.

LICENSE

This software is distributed under The BSD 2-Clause License.