Mail::B...er::Perl(3)
π Mail::Box::Parser::Perl β reading messages from file using Perl π
okay bestie, welcome to Mail::Box::Parser::Perl (3), served fresh from the User Contributed Perl Documentation. pull up a chair, we're parsing emails in pure Perl and it's giving iconic π¦
β¨ NAME β¨
Mail::Box::Parser::Perl β reading messages from file using Perl π
πΈ INHERITANCE πΈ
Mail::Box::Parser::Perl
is a Mail::Box::Parser
is a Mail::Reporter
so yeah, it's got a whole little family tree, and it inherits vibes from both π
π«Ά SYNOPSIS π«Ά
literally nothing here, bestie. the original page has an empty SYNOPSIS section and we are NOT inventing one, no cap. it's a mystery, it's a mood, it's β¨blankβ¨
π DESCRIPTION π
The Mail::Box::Parser::Perl implements parsing of messages in Perl. πͺ
ngl it may be a little slower than the C based parser Mail::Box::Parser::C, but the way that it also works on platforms where no C compiler is available? that's the whole point, that's the slay. π
Extends "DESCRIPTION" in Mail::Box::Parser.
π₯ METHODS π₯
Extends "METHODS" in Mail::Box::Parser.
π§ Constructors π§
Extends "Constructors" in Mail::Box::Parser.
$class->new(%options)β inherited, see "METHODS" in Mail::Box::Parser
here's the options tea, read it and weep (affectionately):
-Option --Defined in --Default
file undef
filename <required>
fix_header_errors Mail::Box::Parser false
mode 'r'
trusted Mail::Box::Parser false
file => $filehandleβ anyIO::FileorGLOB$filehandlewhich can be used to read the data from. In case this option is specified, thefilenameis informational only. π (so the name is just there for the vibes, the actual reading happens through your handle)filename => FILENAMEβ the name of the file to be read. it's<required>, bestie, no skipping it π¨fix_header_errors => BOOLEANβ (inherited fromMail::Box::Parser)mode => $modeβ file open$mode, which defaults to'r', which meansread-only. Seeperldoc -f openfor possible modes. Only applicable when nofileis specified. πtrusted => BOOLEANβ (inherited fromMail::Box::Parser)
π Attributes π
Extends "Attributes" in Mail::Box::Parser.
$any->defaultParserType( [$class] )β inherited, see "Attributes" in Mail::Box::Parser$obj->file()β (no extra notes on this one, it just is π«§)$obj->filename()β returns the name of the file this parser is working on. π$obj->fixHeaderErrors( [BOOLEAN] )β inherited, see "Attributes" in Mail::Box::Parser$obj->openMode()β (again, no description given, she simply exists π )$obj->trusted()β inherited, see "Attributes" in Mail::Box::Parser
π¦ Parsing π¦
Extends "Parsing" in Mail::Box::Parser.
$obj->bodyAsFile( $fh [$chars, [$lines]] )β inherited, see "Parsing" in Mail::Box::Parser$obj->bodyAsList( [$chars, [$lines]] )β inherited, see "Parsing" in Mail::Box::Parser$obj->bodyAsString( [$chars, [$lines]] )β inherited, see "Parsing" in Mail::Box::Parser$obj->bodyDelayed( [$chars, [$lines]] )β inherited, see "Parsing" in Mail::Box::Parser$obj->closeFile()β close the file which was being parsed. bye bestie π$obj->fileChanged()β returns whether the file which is parsed has changed after the last timetakeFileInfo()was called. β°$obj->filePosition( [$position] )β returns the location of the next byte to be used in the file which is parsed. When a$positionis specified, the location in the file is moved to the indicated spot first. π$obj->lineSeparator()β inherited, see "Parsing" in Mail::Box::Parser$obj->openFile(%options)β [3.012] open the file to be parsed. β¨$obj->readHeader()β inherited, see "Parsing" in Mail::Box::Parser$obj->restart(%options)β restart the parser on a certain file, usually because the content has changed. The%optionsare passed toopenFile(). π$obj->start(%options)β start the parser by opening a file.
-Option--Default
file undef
file => FILEHANDLE|undefβ the file is already open, for instance because the data must be read fromSTDIN. π«Ά
$obj->stop()β stop the parser, which will include a close of the file. The lock on the folder will not be removed (is not the responsibility of the parser). Improves base, see "Parsing" in Mail::Box::Parser. π$obj->takeFileInfo()β capture some data about the file being parsed, to be compared later. πΈ
π Error handling π
Extends "Error handling" in Mail::Box::Parser.
$obj->AUTOLOAD()β inherited, see "Error handling" in Mail::Reporter$obj->notImplemented()β inherited, see "Error handling" in Mail::Reporter
π§Ή Cleanup π§Ή
Extends "Cleanup" in Mail::Box::Parser.
$obj->DESTROY()β inherited, see "Cleanup" in Mail::Reporter
π DIAGNOSTICS π
the drama section, buckle up:
- Error:
class $package does not implement method $method.Fatal error: the specific$package(or one of its superclasses) does not implement this method where it should. This message means that some other related classes do implement this method however the class at hand does not. Probably you should investigate this and probably inform the author of the package. Cast bynotImplemented(). π± - Error:
filename or handle required to create a parser.Cast bynew(). (remember what I said,filenameis<required>, fr fr) - Error:
parser $type does not extend $pkg.Cast bydefaultParserType(). - Warning:
unexpected end of header in $file:\n $lineCast byreadHeader(). π
π SEE ALSO π
This module is part of Mail-Message version 4.04, built on February 04, 2026. Website: http://perl.overmeer.net/CPAN/ π
π LICENSE π
For contributors see file ChangeLog.
This software is copyright (c) 2001-2026 by Mark Overmeer.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. π
and that's the whole page, bestie, you ate it up π
signing off with the footer tea: this was perl v5.42.0, dated 2026-02-05, from Mail::B...er::Perl(3). mwah π
β¨
π¦ where this page comes from
- fedora 44: perl-Mail-Message 4.04-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms