> On Feb 15, 2017, at 8:10 PM, Eko Budiharto <eko.budiha...@gmail.com> wrote:
> 
> dear Jim,
> I tried to add lines to read file like this:
> 
> use Email::MIME;
> 
> my $file = '/var/qmail/mailnames/<domain 
> name>/support/Maildir/cur/1487041394.M984019P23084V0000000000000803I0000000000E03878.ABCD.NET,S=3987:2,';
> open my $ifh, '<', $file
>   or die "Cannot open '$file' for reading: $!";
> local $/ = '';
> my $contents = <$ifh>;
> close( $ifh );
> 
> my $mime = Email::MIME->($contents);  —> line 13
> 
> my @parts = $mime->parts();
> 
> for my $npart ( 0..$#parts ) {
>       my $part = $parts[$npart];
>       my $header = $part->header_obj();
>       my $htext = $header->as_string();
>       my $body = $part->body();
> 
>       print $header;
> }
> 
> after I ran its from CLI, I got an error message Undefined subroutine 
> &Email::MIME called at line 13.
> 
> what does the error mean?

That means I mistyped the line. It should be this:

        my $mime = Email::MIME->new($contents);

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to