NAME

Mail::Box::Parser::Lines - reading messages from file using Perl

INHERITANCE

Mail::Box::Parser::Lines
  is a Mail::Box::Parser
  is a Mail::Reporter

SYNOPSIS

DESCRIPTION

This Mail::Box::Parser::Lines implements parsing of messages in Perl, with an ARRAY as source.

Hint: Useful when the message is already in memory. When you plan to use this yourself, you probably need to use Mail::Message::Construct::Read.

Extends "DESCRIPTION" in Mail::Box::Parser.

METHODS

Extends "METHODS" in Mail::Box::Parser.

Constructors

Extends "Constructors" in Mail::Box::Parser.

Mail::Box::Parser::Lines->new(%options)
-Option           --Defined in       --Default
 fix_header_errors  Mail::Box::Parser  <false>
 lines                                 <required>
 log                Mail::Reporter     'WARNINGS'
 source                                <required>
 trace              Mail::Reporter     'WARNINGS'
 trusted            Mail::Box::Parser  <false>
fix_header_errors => BOOLEAN
lines => ARRAY
log => LEVEL
source => STRING
trace => LEVEL
trusted => BOOLEAN

Attributes

Extends "Attributes" in Mail::Box::Parser.

$obj->defaultParserType( [$class] )
Mail::Box::Parser::Lines->defaultParserType( [$class] )

Inherited, see "Attributes" in Mail::Box::Parser

$obj->fixHeaderErrors( [BOOLEAN] )

Inherited, see "Attributes" in Mail::Box::Parser

$obj->lines()

Returns an ARRAY with the remaining lines.

$obj->logSettings()

Inherited, see "Attributes" in Mail::Reporter

$obj->source()

The name of the source.

$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->lineSeparator()

Inherited, see "Parsing" in Mail::Box::Parser

$obj->readHeader()

Inherited, see "Parsing" in Mail::Box::Parser

$obj->stop()

Inherited, see "Parsing" in Mail::Box::Parser

Error handling

Extends "Error handling" in Mail::Box::Parser.

$obj->AUTOLOAD()

Inherited, see "Error handling" in Mail::Reporter

$obj->addReport($object)

Inherited, see "Error handling" in Mail::Reporter

$obj->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level, $callback] )
Mail::Box::Parser::Lines->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level, $callback] )

Inherited, see "Error handling" in Mail::Reporter

$obj->errors()

Inherited, see "Error handling" in Mail::Reporter

$obj->log( [$level, [$strings]] )
Mail::Box::Parser::Lines->log( [$level, [$strings]] )

Inherited, see "Error handling" in Mail::Reporter

$obj->logPriority($level)
Mail::Box::Parser::Lines->logPriority($level)

Inherited, see "Error handling" in Mail::Reporter

$obj->notImplemented()

Inherited, see "Error handling" in Mail::Reporter

$obj->report( [$level] )

Inherited, see "Error handling" in Mail::Reporter

$obj->reportAll( [$level] )

Inherited, see "Error handling" in Mail::Reporter

$obj->trace( [$level] )

Inherited, see "Error handling" in Mail::Reporter

$obj->warnings()

Inherited, see "Error handling" in Mail::Reporter

Cleanup

Extends "Cleanup" in Mail::Box::Parser.

$obj->DESTROY()

Inherited, see "Cleanup" in Mail::Reporter

DIAGNOSTICS

Error: Package $package does not implement $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.

Warning: Unexpected end of header in $source: $line

While parsing a message from the specified source (usually a file name), the parser found a syntax error. According to the MIME specification in the RFCs, each header line must either contain a colon, or start with a blank to indicate a folded field. Apparently, this header contains a line which starts on the first position, but not with a field name.

By default, parsing of the header will be stopped. If there are more header lines after the erroneous line, they will be added to the body of the message. In case of new(fix_header_errors) set, the parsing of the header will be continued. The erroneous line will be added to the preceding field.

SEE ALSO

This module is part of Mail-Message distribution version 3.018_001, built on August 21, 2025. Website: http://perl.overmeer.net/CPAN/

LICENSE

Copyrights 2001-2025 by [Mark Overmeer <markov@cpan.org>]. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/