Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: Parsing an email

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


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

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.

Replies are listed 'Best First'.
Re^4: Parsing an email
by kcott (Archbishop) on Jan 10, 2022 at 01:51 UTC

    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

Re^4: Parsing an email
by Fletch (Bishop) on Jan 10, 2022 at 01:57 UTC

    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.

        This might be useful, although the instruction to drop files into C:\Windows\System32 is not something I would follow.

        https://github.com/hey-red/Mime/issues/9

        Update: Although there is an Alien package Alien::LibMagic which will get you the DLL to link against when compiling File::LibMagic.

        Update 2: ...although compilation of libmagic needs libgnurx so the Alien does not work on my Windows machine. One could develop an Alien::libgnurx but I suspect that would simply be the start of a journey down a rabbit hole of dependencies...

        Ew. Yeah no clue, don't really do windows (especially not building stuff there; if I do I use cygwin which is back to *NIX-y stuff). Did find https://github.com/nscaife/file-windows which looks to maybe be a port of the library that has a DLL version (which would be what you'd need on wintendo rather than an shared object ".so" file) but . . . /shrug

        So yeah Mail::Box may be the simpler route at this point if it installs cleaner for you.

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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-25 08:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found