Re: Can't use string ("MODULE") as a HASH ref while "strict refs" in use
David A Golden <[email protected]> Tue, 10 Aug 2004 13:45:59 -0400
| Newsgroups | gmane.comp.lang.perl.modules.mail-box |
|---|---|
| Message-ID | <5.2.0.9.2.20040810134541.00bad4a0@localhost> |
What version of Perl and what version of Mail::Box are you using?
David
At 8/10/2004 01:39 PM, M M wrote:
>Hi there !
>
>
>I did post this to perlmonks and someone suggested I try this
>mail-list. I am trying to write a simple program to add some messages
>to an MBOX. Here is my code:
>------------------
>use strict; use English; use warnings;
>
>use Mail::Box::Mbox;
>
>my $foldername = 'test.mbox';
>my $folder = Mail::Box::Mbox->create($foldername, access => 'rw');
>
>my $msg;
>my $n =4;
>
>while ($n--) {
>
>my $msg = Mail::Box::Message->build(From => 'me', data => "Message
>$n\n only two\nlines\n---\n");
>
> $msg->print;
>$folder->addMessage( $msg );
>}
>
>Here is the error I get:
>
>Can't use string ("Mail::Box::Mbox") as a HASH ref while "strict refs"
>+ in use at I:/Perl/site/lib/Mail/Box.pm line 816.
>---------------------
>Thanks !
>
>P.S. I have attached the perl source in case the formatting is screwed up.
>
>Thanks !