Scroll to navigation

Sisimai::Mail::STDIN(3pm) User Contributed Perl Documentation Sisimai::Mail::STDIN(3pm)

NAME

Sisimai::Mail::STDIN - Mailbox reader

SYNOPSIS

    use Sisimai::Mail::STDIN;
    my $mailbox = Sisimai::Mail::STDIN->new();
    while( my $r = $mailbox->read ) {
        print $r;   # print data read from STDIN
    }
    $mailbox->close;

DESCRIPTION

Sisimai::Mail::STDIN read email data from STDIN.

CLASS METHODS

"new()"

"new()" is a constructor of Sisimai::Mail::STDIN

    my $mailbox = Sisimai::Mail::STDIN->new();

INSTANCE METHODS

"path()"

"path()" returns "<STDIN>"

    print $mailbox->path;   # "<STDIN>"

"name()"

"name()" returns "<STDIN>"

    print $mailbox->name;   # "<STDIN>"

"size()"

"size()" returns "undef"

    print $mailbox->size;   # undef

"offset()"

"offset()" returns offset position for seeking the mbox. The value of "offset" is bytes which have already read.

    print $mailbox->offset;   # 0

"handle()"

"handle()" returns file handle object (IO::Handle) of the mbox.

    $mailbox->handle->close;

"read()"

"read()" works as a iterator for reading each email in the mbox.

    my $mailbox = Sisimai::Mail->new();
    while( my $r = $mailbox->read ) {
        print $r;   # print data read from STDIN
    }

AUTHOR

azumakuniyuki

COPYRIGHT

Copyright (C) 2014-2016,2018 azumakuniyuki, All rights reserved.

LICENSE

This software is distributed under The BSD 2-Clause License.
2018-11-15 perl v5.28.0