Sisima...:Memory(3pm)

✨ NAME ✨

Sisimai::Mail::Memory β€” bestie, it's a mail*box* reader πŸ’Œ (and yeah, the page header on this one is literally Sisima...:Memory(3pm), typos and all, we don't make the rules 🫢)


🌸 SYNOPSIS 🌸

use Sisimai::Mail::Memory;
my $mailtxt = 'From Mailer-Daemon ...';
my $mailobj = Sisimai::Mail::Memory->new(\$mailtxt);
while( my $r = $mailobj->read ) {
    print $r;   # print contents of each mail in the mailbox or Maildir/
}

okay so that's the whole vibe, you hand it a variable and it reads mail out of it like it's a frickin mailbox, iconic πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

Sisimai::Mail::Memory is a class for reading a mailbox, files in Maildir/ from the value of the specified variable. like, no actual files on disk need to be involved, you just give it the goods directly ✨


πŸŽ€ CLASS METHODS πŸŽ€

πŸ’– new(\$scalar)

new() method is a constructor of Sisimai::Mail::Memory β€” it's giving "make me a mail object, I'll bring my own string" 🌈

my $mailtxt = 'From Mailer-Daemon ...';
my $mailobj = Sisimai::Mail::Memory->new(\$mailtxt);

⭐ INSTANCE METHODS ⭐

🌸 path()

path() method returns a fixed string "<MEMORY>" β€” real "no thoughts, head empty, hardcoded" energy, but like, on purpose πŸ‘‘

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

🧚 size()

size() method returns a memory size of the mailbox πŸ“

print $mailobj->size;   # 94515

πŸ¦‹ payload()

payload() method returns an array reference to each email message πŸ’Œ

print scalar $mailobj->payload->@*; # 17

πŸ’œ offset()

offset() method returns the offset position for seeking payload list. The value of offset is an index number which have already read. like a lil bookmark for your reading progress, we love a tracking queen πŸ“–βœ¨

print $mailobj->offset;   # 0

πŸ”₯ read()

read() method works as an iterator for reading each email in the mailbox. it just keeps handing you the next one until it's out, no cap πŸ™ˆ

my $mailtxt = 'From Mailer-Daemon ...';
my $mailobj = Sisimai::Mail->new(\$mailtxt);
while( my $r = $mailobj->read ) {
    print $r;   # print each email in the first argument of new().
}
heads up bestie, the example above literally calls Sisimai::Mail->new(\$mailtxt) β€” not Sisimai::Mail::Memory. that's what the page says, so that's what I'm giving you, don't @ me πŸ’€

πŸ‘‘ AUTHOR πŸ‘‘

azumakuniyuki


Copyright (C) 2018-2022,2024,2025 azumakuniyuki, All rights reserved.


πŸ’… LICENSE πŸ’…

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


and that's the whole page, periodt 🫢 this one's running on perl v5.40.1, dated 2026-07-05, and it lives under the manual name Sisima...:Memory(3pm) β€” part of User Contributed Perl Documentation, which, yeah, the people really did contribute it πŸ’– mwah, go read some mail ✨

πŸ“¦ where this page comes from