Mail::MBX::Message - An MBX mailbox message object
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;
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.
Mail::MBX::Message
Mail::MBX
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.
Written by Xan Tronix <xan@cpan.org>
Copyright (c) 2014, cPanel, Inc. Distributed under the terms of the MIT license.
To install Mail::MBX, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mail::MBX
CPAN shell
perl -MCPAN -e shell install Mail::MBX
For more information on module installation, please visit the detailed CPAN module installation guide.