logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Sisimai::Mail::STDIN - Mailbox reader

Author

       azumakuniyuki

Class Methods

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

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

Description

       "Sisimai::Mail::STDIN" read email data from Standard-In

Instance Methods

"path()"
       path() metehod returns a fixed string ""<STDIN"">

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

   "size()"
       size() method returns the data size which has been read

           print $mailbox->size;   # 2202

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

           print $mailbox->offset;   # 0

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

           $mailbox->handle;

   "read()"
       read() method works as an 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
           }

License

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

perl v5.40.1                                       2025-04-12                          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
           }

See Also