Mail::...etaInfo(3pm)
π Mail::...etaInfo(3pm) β bestie's guide to Mail::Mbox::MessageParser::MetaInfo π
okay so like, picture this: you're out here parsing mbox folders, and every single time you do it you're re-reading the same bytes like a clown π. This module said "not on my watch" and built you a whole cache for folder metadata so you never have to do that again. Iconic behaviour fr fr.
β¨ NAME β¨
Mail::Mbox::MessageParser::MetaInfo β a cache for folder metadata. she's the girl who remembers where everything is so you don't have to π
π¦ DESCRIPTION π¦
This module implements a cache for meta-information for mbox folders. The information includes such items such as the file position, the line number, and the byte offset of the start of each email.
basically it's keeping receipts on your mailbox so the next parse is a little speedrun π
πΈ METHODS AND FUNCTIONS πΈ
π« SETUP_CACHE(...) π«
SETUP_CACHE( { 'file_name' => <cache file name> } );
<cache file name> - the file name of the cache
Call this function once to set up the cache before creating any parsers. You must provide the location to the cache file. There is no default value β like, none, zero, nada, you have to tell her where to put it bestie π«Ά.
Returns an error string or 1 if there is no error.
π« CLEAR_CACHE(); π«
Use this function to clear the cache and delete the cache file. Normally you should not need to clear the cache β the module will automatically update the cache when the mailbox changes. Call this function after SETUP_CACHE.
it's giving "nuclear option" ngl π but sometimes you just gotta β¨resetβ¨
π« WRITE_CACHE(); π«
Use this function to force the module to write the in-memory cache information to the cache file. Normally you do not need to do this β the module will automatically write the information when the program exits.
so like, she handles it herself, but if you're the impatient type, here's your button π
π« $ref = new( { 'file_name' => <mailbox file name>, 'file_handle' => <mailbox file handle>, }); π«
<file_name>β The full filename of the mailbox<file_handle>β An opened file handle for the mailbox
The constructor for the class takes two parameters. file_name is the filename of the mailbox. This will be used as the cache key, so it's important that it fully defines the path to the mailbox. The file_handle argument is the opened file handle to the mailbox. Both arguments are required.
Returns a reference to a Mail::Mbox::MessageParser object, or a string describing the error.
lowkey the cache key thing matters so much β if your path isn't the full path, she's gonna think it's a whole different mailbox and you'll be so confused. give her the WHOLE path bestie π€
π BUGS π
No known bugs. she's perfect, she's booked, she's busy π
Contact david@coppit.org for bug reports and suggestions.
π AUTHOR π
David Coppit <david@coppit.org>.
π LICENSE π
This code is distributed under the GNU General Public License (GPL) Version 2. See the file LICENSE in the distribution for details.
π HISTORY π
This code was originally part of the grepmail distribution. See http://grepmail.sf.net/ for previous versions of grepmail which included early versions of this code.
glow up story honestly, from grepmail side quest to main character energy β¨
π₯ SEE ALSO π₯
Mail::Mbox::MessageParser
and that's the whole vibe check, bestie β go forth and cache responsibly π§π
this page came to you via perl v5.36.0, dated 2023-08-06, from the Mail::...etaInfo(3pm) manual β mwah, stan, bye π
π¦ where this page comes from
- debian trixie: libmail-mbox-messageparser-perl 1.5111-3 Β· GPL-2.0-only
- ubuntu noble: libmail-mbox-messageparser-perl 1.5111-3 Β· GPL-2.0-only
- ubuntu resolute: libmail-mbox-messageparser-perl 1.5111-3 Β· GPL-2.0-only
- ubuntu stonking: libmail-mbox-messageparser-perl 1.5111-3 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms