NAME

Mail::MBX::Message - An MBX mailbox message object

SYNOPSIS

use Mail::MBX ();

my $mbx = Mail::MBX->open('mailbox.mbx');

#
# Fetch and read first message in mailbox
#
my $message = $mbx->message;

#
# Write message body to standard output
#
while (my $readlen = $message->read(my $buf, 4096)) {
    print $buf;
}

$mbx->close;

DESCRIPTION

Mail::MBX::Message represents an MBX message object within an existing Mail::MBX file object. Because Mail::MBX::Message objects contain state specific to the parent object's file handle, only one message can be read per mailbox at a time.

USAGE

Mail::MBX::Message->parse($fh)

Not intended to be used as part of a public interface. Given the file handle specified in $fh, this method will return a new Mail::MBX::Message object representing the message found at the current position of $fh.

$message->reset()

Reset internal file handle position to beginning of message.

$message->read($buf, $len)

Read at most $len bytes from the current message, into a scalar variable in the argument of $buf, and return the number of bytes actually read from the current message.

AUTHOR

Written by Xan Tronix <xan@cpan.org>

COPYRIGHT

Copyright (c) 2014, cPanel, Inc. Distributed under the terms of the MIT license.