Greetings folk monks,

I'm currently rewriting a script that used Net::POP3 and Mail::Internet to use the Mail::Box series of modules.

I've been scouring the documentation for Mail::Box and have managed to get most things working - except for displaying a message, either as part of a loop or individually.

What follows is the basic script I'm using:

#! /usr/bin/perl -w # ignoring -T - just testing. use strict; use Mail::Box::Manager; die "Usage: $0 message_number\n" unless @ARGV==1; my $msg_num = shift @ARGV; my $mailspool = "/var/spool/mail/baz"; my $mgr = Mail::Box::Manager->new; my $folder = $mgr->open($mailspool); # Get message specified on command line. my $message $folder->message($msg_num); print $message; $folder->close;

This code runs without errors and returns

Mail::Box::Mbox::Message=HASH(0x84c560)
Or some other reference to a hash, so I changed print $message to print %$message, only to get the same output.

I'm not finding anything helpful in the Mail::Box-Cookbook or Mail::Box::Mbox::Message manpages.

Is there something that I'm missing here? My code is basically the same as that shown in the Mail::Box manual!

Could someone please enlighten me, please?
I've only found one node ( Mail::Box-addMessage vs. Net::Pop3 ) that even mentions Mail::Box, and it's not relevant to this problem.

Cheers,

BazB.


In reply to Problems displaying a single message with Mail::Box by BazB

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.