On MacOS 10.13.6 High Sierra, I want to convert a list of mails that I have exported in eml format files (with Thunderbird), to HTML files.
To perform this, I have installed the tool called "mhonarc".
But at the execution, when I do :
mhonarc -outdir /Users/peter/Mails_HTML /Users/peter/Mails
I get the following error :
Can't use 'defined(%hash)' (Maybe you should just omit the defined()?) at /opt/local/lib/perl5/vendor_perl/5.28/darwin-thread-multi-2level/mhamain.pl line 1565.
Compilation failed in require at /opt/local/bin/mhonarc line 39.
I don't know if I have the right Perl version. I have installed perl5.26 and perl5.28 via macports
and the 3 following macports packages :
p5-mhonarc @2.6.19 (perl)
MHonArc - mail and news munging
p5.26-mhonarc @2.6.19 (perl)
MHonArc - mail and news munging
p5.28-mhonarc @2.6.19 (perl)
MHonArc - mail and news munging
after having done : sudo port searc mhonarc
I think there are conflicts between the native Perl of High Sierra and the Perl package installed with macports
but I am not sure.
Edit 1
If I do which perl
, I get : /opt/local/bin/perl
, so I infer that I am using a version installed from macports
.
Here the versions installed and potentially used by mhonarc
:
$ /opt/local/bin/perl --version
This is perl 5, version 26, subversion 3 (v5.26.3) built for darwin- thread-multi-2level
Copyright 1987-2018, Larry Wall
and
$ /usr/bin/perl --version
This is perl 5, version 18, subversion 2 (v5.18.2) built for darwin-thread-multi-2level
(with 2 registered patches, see perl -V for more detail)
Copyright 1987-2013, Larry Wall
Edit 2
I followed suggestion done by @choroba
: I replaced all all defined(%variable_name) by just %variable_name
So the command mhonarc -outdir /Users/peter/Mails_HTML /Users/peter/Mails
doesn't produce error but the issue now is that doesn't produce any mail under HTML format in the directory /Users/peter/Mails_HTML
I get the following output:
This is MHonArc v2.6.19, Perl 5.028002 darwin
Converting messages to /Users/peter/Mails_HTML/
Reading /Users/peter/Mails
Writing mail
Writing /Users/peter/Mails_HTML//maillist.html ...
Writing /Users/peter/Mails_HTML//threads.html ...
Writing database ...
0 total messages
What could be the origin of this behavior ?
Edit 3
Problem finally fixed by the modified command line :
mhonarc -outdir /Users/peter/Mails_HTML /Users/peter/Mails/*
which produces all HTML files in /Users/peter/Mails_HTML
directory. there is just the dates of email that are missing, I am going to do research for adding this information.