.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "Mail::Box::Parser::Perl 3" .TH Mail::Box::Parser::Perl 3 2026-04-11 "perl v5.42.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Mail::Box::Parser::Perl \- reading messages from file using Perl .SH INHERITANCE .IX Header "INHERITANCE" .Vb 3 \& Mail::Box::Parser::Perl \& is a Mail::Box::Parser \& is a Mail::Reporter .Ve .SH SYNOPSIS .IX Header "SYNOPSIS" .SH DESCRIPTION .IX Header "DESCRIPTION" The \f(CW\*(C`Mail::Box::Parser::Perl\*(C'\fR implements parsing of messages in Perl. This may be a little slower than the \f(CW\*(C`C\*(C'\fR based parser Mail::Box::Parser::C, but will also work on platforms where no C compiler is available. .PP Extends "DESCRIPTION" in Mail::Box::Parser. .SH METHODS .IX Header "METHODS" Extends "METHODS" in Mail::Box::Parser. .SS Constructors .IX Subsection "Constructors" Extends "Constructors" in Mail::Box::Parser. .ie n .IP $class\->\fBnew\fR(%options) 4 .el .IP \f(CW$class\fR\->\fBnew\fR(%options) 4 .IX Item "$class->new(%options)" Inherited, see "METHODS" in Mail::Box::Parser .Sp .Vb 6 \& \-Option \-\-Defined in \-\-Default \& file undef \& filename \& fix_header_errors Mail::Box::Parser false \& mode \*(Aqr\*(Aq \& trusted Mail::Box::Parser false .Ve .RS 4 .ie n .IP "file => $filehandle" 2 .el .IP "file => \f(CW$filehandle\fR" 2 .IX Item "file => $filehandle" Any IO::File or \f(CW\*(C`GLOB\*(C'\fR \f(CW$filehandle\fR which can be used to read the data from. In case this option is specified, the \f(CW\*(C`filename\*(C'\fR is informational only. .IP "filename => FILENAME" 2 .IX Item "filename => FILENAME" The name of the file to be read. .IP "fix_header_errors => BOOLEAN" 2 .IX Item "fix_header_errors => BOOLEAN" .PD 0 .ie n .IP "mode => $mode" 2 .el .IP "mode => \f(CW$mode\fR" 2 .IX Item "mode => $mode" .PD File open \f(CW$mode\fR, which defaults to \f(CW\*(Aqr\*(Aq\fR, which means \`read\-only\*(Aq. See \f(CW\*(C`perldoc \-f open\*(C'\fR for possible modes. Only applicable when no \f(CW\*(C`file\*(C'\fR is specified. .IP "trusted => BOOLEAN" 2 .IX Item "trusted => BOOLEAN" .RE .RS 4 .RE .SS Attributes .IX Subsection "Attributes" Extends "Attributes" in Mail::Box::Parser. .ie n .IP "$any\->\fBdefaultParserType\fR( [$class] )" 4 .el .IP "\f(CW$any\fR\->\fBdefaultParserType\fR( [$class] )" 4 .IX Item "$any->defaultParserType( [$class] )" Inherited, see "Attributes" in Mail::Box::Parser .ie n .IP $obj\->\fBfile\fR() 4 .el .IP \f(CW$obj\fR\->\fBfile\fR() 4 .IX Item "$obj->file()" .ie n .IP $obj\->\fBfilename\fR() 4 .el .IP \f(CW$obj\fR\->\fBfilename\fR() 4 .IX Item "$obj->filename()" Returns the name of the file this parser is working on. .ie n .IP "$obj\->\fBfixHeaderErrors\fR( [BOOLEAN] )" 4 .el .IP "\f(CW$obj\fR\->\fBfixHeaderErrors\fR( [BOOLEAN] )" 4 .IX Item "$obj->fixHeaderErrors( [BOOLEAN] )" Inherited, see "Attributes" in Mail::Box::Parser .ie n .IP $obj\->\fBopenMode\fR() 4 .el .IP \f(CW$obj\fR\->\fBopenMode\fR() 4 .IX Item "$obj->openMode()" .ie n .IP $obj\->\fBtrusted\fR() 4 .el .IP \f(CW$obj\fR\->\fBtrusted\fR() 4 .IX Item "$obj->trusted()" Inherited, see "Attributes" in Mail::Box::Parser .SS Parsing .IX Subsection "Parsing" Extends "Parsing" in Mail::Box::Parser. .ie n .IP "$obj\->\fBbodyAsFile\fR( $fh [$chars, [$lines]] )" 4 .el .IP "\f(CW$obj\fR\->\fBbodyAsFile\fR( \f(CW$fh\fR [$chars, [$lines]] )" 4 .IX Item "$obj->bodyAsFile( $fh [$chars, [$lines]] )" Inherited, see "Parsing" in Mail::Box::Parser .ie n .IP "$obj\->\fBbodyAsList\fR( [$chars, [$lines]] )" 4 .el .IP "\f(CW$obj\fR\->\fBbodyAsList\fR( [$chars, [$lines]] )" 4 .IX Item "$obj->bodyAsList( [$chars, [$lines]] )" Inherited, see "Parsing" in Mail::Box::Parser .ie n .IP "$obj\->\fBbodyAsString\fR( [$chars, [$lines]] )" 4 .el .IP "\f(CW$obj\fR\->\fBbodyAsString\fR( [$chars, [$lines]] )" 4 .IX Item "$obj->bodyAsString( [$chars, [$lines]] )" Inherited, see "Parsing" in Mail::Box::Parser .ie n .IP "$obj\->\fBbodyDelayed\fR( [$chars, [$lines]] )" 4 .el .IP "\f(CW$obj\fR\->\fBbodyDelayed\fR( [$chars, [$lines]] )" 4 .IX Item "$obj->bodyDelayed( [$chars, [$lines]] )" Inherited, see "Parsing" in Mail::Box::Parser .ie n .IP $obj\->\fBcloseFile\fR() 4 .el .IP \f(CW$obj\fR\->\fBcloseFile\fR() 4 .IX Item "$obj->closeFile()" Close the file which was being parsed. .ie n .IP $obj\->\fBfileChanged\fR() 4 .el .IP \f(CW$obj\fR\->\fBfileChanged\fR() 4 .IX Item "$obj->fileChanged()" Returns whether the file which is parsed has changed after the last time \fBtakeFileInfo()\fR was called. .ie n .IP "$obj\->\fBfilePosition\fR( [$position] )" 4 .el .IP "\f(CW$obj\fR\->\fBfilePosition\fR( [$position] )" 4 .IX Item "$obj->filePosition( [$position] )" Returns the location of the next byte to be used in the file which is parsed. When a \f(CW$position\fR is specified, the location in the file is moved to the indicated spot first. .ie n .IP $obj\->\fBlineSeparator\fR() 4 .el .IP \f(CW$obj\fR\->\fBlineSeparator\fR() 4 .IX Item "$obj->lineSeparator()" Inherited, see "Parsing" in Mail::Box::Parser .ie n .IP $obj\->\fBopenFile\fR(%options) 4 .el .IP \f(CW$obj\fR\->\fBopenFile\fR(%options) 4 .IX Item "$obj->openFile(%options)" Open the file to be parsed. .ie n .IP $obj\->\fBreadHeader\fR() 4 .el .IP \f(CW$obj\fR\->\fBreadHeader\fR() 4 .IX Item "$obj->readHeader()" Inherited, see "Parsing" in Mail::Box::Parser .ie n .IP $obj\->\fBrestart\fR(%options) 4 .el .IP \f(CW$obj\fR\->\fBrestart\fR(%options) 4 .IX Item "$obj->restart(%options)" Restart the parser on a certain file, usually because the content has changed. The \f(CW%options\fR are passed to \fBopenFile()\fR. .ie n .IP $obj\->\fBstart\fR(%options) 4 .el .IP \f(CW$obj\fR\->\fBstart\fR(%options) 4 .IX Item "$obj->start(%options)" Start the parser by opening a file. .Sp .Vb 2 \& \-Option\-\-Default \& file undef .Ve .RS 4 .IP "file => FILEHANDLE|undef" 2 .IX Item "file => FILEHANDLE|undef" The file is already open, for instance because the data must be read from STDIN. .RE .RS 4 .RE .ie n .IP $obj\->\fBstop\fR() 4 .el .IP \f(CW$obj\fR\->\fBstop\fR() 4 .IX Item "$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 .ie n .IP $obj\->\fBtakeFileInfo\fR() 4 .el .IP \f(CW$obj\fR\->\fBtakeFileInfo\fR() 4 .IX Item "$obj->takeFileInfo()" Capture some data about the file being parsed, to be compared later. .SS "Error handling" .IX Subsection "Error handling" Extends "Error handling" in Mail::Box::Parser. .ie n .IP $obj\->\fBAUTOLOAD\fR() 4 .el .IP \f(CW$obj\fR\->\fBAUTOLOAD\fR() 4 .IX Item "$obj->AUTOLOAD()" Inherited, see "Error handling" in Mail::Reporter .ie n .IP $obj\->\fBnotImplemented\fR() 4 .el .IP \f(CW$obj\fR\->\fBnotImplemented\fR() 4 .IX Item "$obj->notImplemented()" Inherited, see "Error handling" in Mail::Reporter .SS Cleanup .IX Subsection "Cleanup" Extends "Cleanup" in Mail::Box::Parser. .ie n .IP $obj\->\fBDESTROY\fR() 4 .el .IP \f(CW$obj\fR\->\fBDESTROY\fR() 4 .IX Item "$obj->DESTROY()" Inherited, see "Cleanup" in Mail::Reporter .SH DIAGNOSTICS .IX Header "DIAGNOSTICS" .ie n .IP "Error: class $package does not implement method $method." 4 .el .IP "Error: class \f(CW$package\fR does not implement method \f(CW$method\fR." 4 .IX Item "Error: class $package does not implement method $method." Fatal error: the specific \f(CW$package\fR (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 \f(CWnotImplemented()\fR .IP "Error: filename or handle required to create a parser." 4 .IX Item "Error: filename or handle required to create a parser." Cast by \f(CWnew()\fR .ie n .IP "Error: parser $type does not extend $pkg." 4 .el .IP "Error: parser \f(CW$type\fR does not extend \f(CW$pkg\fR." 4 .IX Item "Error: parser $type does not extend $pkg." Cast by \f(CWdefaultParserType()\fR .ie n .IP "Warning: unexpected end of header in $file:\en $line" 4 .el .IP "Warning: unexpected end of header in \f(CW$file:\fR\en \f(CW$line\fR" 4 .IX Item "Warning: unexpected end of header in $file:n $line" Cast by \f(CWreadHeader()\fR .SH "SEE ALSO" .IX Header "SEE ALSO" This module is part of Mail\-Message version 4.05, built on April 10, 2026. Website: \fIhttp://perl.overmeer.net/mailbox/\fR .SH LICENSE .IX Header "LICENSE" For contributors see file ChangeLog. .PP This software is copyright (c) 2001\-2026 by Mark Overmeer. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.