Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Parsing an email

by BernieC (Pilgrim)
on Jan 09, 2022 at 19:34 UTC ( [id://11140305]=note: print w/replies, xml ) Need Help??


in reply to Re: Parsing an email
in thread Parsing an email

Mail::Box looks like it'll work but Courriel looks like exactly what I wanted: "This class exists to provide a high level API for working with emails, particular for processing incoming email." Thanks!!

Replies are listed 'Best First'.
Re^3: Parsing an email
by BernieC (Pilgrim) on Jan 09, 2022 at 23:29 UTC
    Dumb question -- I did a "cpan i Courriel" and it seems to have installed without its documentation:
    D:\>perldoc Courriel No documentation found for "Courriel".
    I've downloaded the tar.gz for it and I've pawed through it and I can't see anything that looks like a .pod or .1 file in it.. so I dunno what to do next.

      As I indicated earlier, "I haven't used it myself". I installed it using the built-in cpan utility; but very slightly differently to you:

      $ cpan cpan shell -- CPAN exploration and modules installation (v2.29) Enter 'h' for help. cpan[1]> install Courriel ...

      I don't believe that should make any difference. The output included:

      Installing /home/ken/perl5/perlbrew/perls/perl-5.34.0/man/man3/Courrie +l.3pm Installing /home/ken/perl5/perlbrew/perls/perl-5.34.0/man/man3/Courrie +l.Builder.3pm Installing /home/ken/perl5/perlbrew/perls/perl-5.34.0/man/man3/Courrie +l.Header.3pm Installing /home/ken/perl5/perlbrew/perls/perl-5.34.0/man/man3/Courrie +l.Header.ContentType.3pm Installing /home/ken/perl5/perlbrew/perls/perl-5.34.0/man/man3/Courrie +l.Header.Disposition.3pm Installing /home/ken/perl5/perlbrew/perls/perl-5.34.0/man/man3/Courrie +l.HeaderAttribute.3pm Installing /home/ken/perl5/perlbrew/perls/perl-5.34.0/man/man3/Courrie +l.Headers.3pm Installing /home/ken/perl5/perlbrew/perls/perl-5.34.0/man/man3/Courrie +l.Part.Multipart.3pm Installing /home/ken/perl5/perlbrew/perls/perl-5.34.0/man/man3/Courrie +l.Part.Single.3pm Installing /home/ken/perl5/perlbrew/perls/perl-5.34.0/man/man3/Email.A +bstract.Courriel.3pm

      I successfully checked that I could load the module:

      $ perl -e 'use Courriel'

      I then tried perldoc Courriel:

      NAME Courriel - High level email parsing and manipulation VERSION version 0.49 SYNOPSIS ...

      I also tried man Courriel. This was similarly successful.

      I've no idea why perldoc reported 'No documentation found for "Courriel".' for you. Does perldoc display documentation for other modules you've installed with cpan? Do you have any better success with man Courriel?

      "I've downloaded the tar.gz for it and I've pawed through it and I can't see anything that looks like a .pod or .1 file in it.. so I dunno what to do next."

      The POD is included with the .pm file. If you view the source, you'll see near the end: "316 lines of Pod".

      As a workaround, you could try:

      $ perl -e 'use Courriel; system perldoc => $INC{"Courriel.pm"}'

      — Ken

      Not sure but you might check that you actually installed the module. This needs a C library and the File::LibMagic module on top of that and when I tried installing and I had to force the install because that prerequisite module's tests failed (OS X, perl 5.34.0; so not necessarily the same as your problem since you look to be on windows).

      That being said as soon as I'd forced the prerequisite and got Courriel itself to install a perldoc Courriel worked fine (the documentation is embedded in the module's .pm source). You also can follow that link to CPAN and read the documentation online there.

      Edit: Just to clarify: I did a brew install libmagic and got the C library, but even after doing that I got errors from File::LibMagic's tests when it went to install and I had to cpanm --force File::LibMagic. I haven't tried to use either it or Courriel past doing perldoc Courriel so I have no clue if I've got a huge basket of broked or not.

      The cake is a lie.
      The cake is a lie.
      The cake is a lie.

        That seems to be it. I didn't watch the install carefully enought {sigh} and it tells me:
        This module requires the libmagic.so library and magic.h header. See INSTALL.md for more details on installing these.
        I expect/hope after i get that fixed it'll install properly
        OK. I've pawed through the distro and, as warned, I've run headlong into
        Installing File-LibMagic Installing File-LibMagic requires that you have the *libmagic.so* libr +ary and the *magic.h* header file installed.
        But it doesn't say *HOW*. I did a web search and I was only able to find libmagic.so for various Unix versions. Nothing for windows. and some more poking around {since I didn't know what a .so file is} tells me
        What is a SO file? An SO file is a shared library used by programs ins +talled on the Linux and Android operating systems. It contains common + program functions and logic that multiple programs require access to +.
        I'm guessing that that likely means you can't run Corriel on Windows. sigh... I'll give Mail::Box another look.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11140305]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2024-04-25 21:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found