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 β€” any IO::File or GLOB $filehandle which can be used to read the data from. In case this option is specified, the filename is 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 from Mail::Box::Parser)
  • mode => $mode β€” file open $mode, which defaults to 'r', which means read-only. See perldoc -f open for possible modes. Only applicable when no file is specified. πŸ“–
  • trusted => BOOLEAN β€” (inherited from Mail::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 time takeFileInfo() was called. ⏰
  • $obj->filePosition( [$position] ) β€” returns the location of the next byte to be used in the file which is parsed. When a $position is 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 %options are passed to openFile(). πŸ”„
  • $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 from STDIN. 🫢
  • $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 by notImplemented(). 😱
  • Error: filename or handle required to create a parser. Cast by new(). (remember what I said, filename is <required>, fr fr)
  • Error: parser $type does not extend $pkg. Cast by defaultParserType().
  • Warning: unexpected end of header in $file:\n $line Cast by readHeader(). πŸ™ˆ

🌈 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