blackadder has asked for the wisdom of the Perl Monks concerning the following question:

I have this bit of simple code
use LWP::Simple; use HTML::Parse; print parse_html(get ($ARGV[0]))->format;
I get the following error
Can't locate HTML/FormatText.pm in @INC (@INC contains: C:/Perl/lib C: +/Perl/site /lib .) at C:/Perl/site/lib/HTML/Element.pm line 1823.
I use ppm3 and have every single repository mentioned in Perl documentation 5.8.0 set up but still can’t locate “HTML/FormatText” module. And, I am not sure if this error is misleading or correct,…..Please help.

Replies are listed 'Best First'.
Re: Can't locate HTML/FormatText.pm
by Cody Pendant (Prior) on Nov 11, 2003 at 20:38 UTC
      To easily install even non-XS CPAN modules you need a third party tool called make. Some people haven't been so blessed as to receive this critical program bundled with their OS. This is one of the many reasons ExtUtils::MakeMaker is ever so slowly giving way to Module::Build.

      (Update: I see the CPAN Make module has instructions for installing itself without a preexisting make :)

        Is there away that I can use CPAN to install modules using ppm3? A URL to the exact repository location will be really handy.

        Thanks.
Re: Can't locate HTML/FormatText.pm
by jdtoronto (Prior) on Nov 12, 2003 at 03:27 UTC
    You should also check out: Crazy Insomniac . He has a repository and takes requests. But if it is a non-XS module then you should get 'nmake' from the Microsoft site, the instructions on how to do this are in a number of places. A 'super-search' here in the monastery will produce at least one if not more good tutorials on the subject. Don't be daunted, just because youare stuck with Windows doesn't mean you cant play!

    BTW - the way module names are constructed - HTML/FormatText.pm will be found in a directory of that name below one of teh directories shown in the environment variable @INC. The clue is to realise that the module itself will be HTML::FormatText. In your case it would seem that somehow a module has been built to a PPM without the dependencies being resolved.

    jdtoronto

      Thanks for this, it’s has been quite an enlightenment.

      HTML::FormatText. has dependency on HTML::Element. although I have HTML::Element::Extended installed, but nmake still fails (error flagging the dependencies). Search on CPAN for HTML::Element revealed HTML::Tree instead. The later has dependencies on other 3 packages at least, and I suspect this will go on and on. None of these packages are available on any PPM3 enabled repositories listed in Perl docs!

      My aim is to learn web programming. So to begin with, I started reading Perl docs on LWP and the short tutorial provided. However I could not get in grips with the document - I suspect the tutorial would a valuable reference and good aid to refresh your module knowledge once you have learnt it - Then I obtained Perl Web program book (with the pelican cover), which I think its an excellent book, but trouble is I couldn’t progress beyond the second example because of unavailability of these modules.

      My questions are; Can I play LWP even though I am on an M$ WinXp operating system? Is there away that I can achieve my learning goals on win32 based system and be able to install those packages?

      Thanks for your help and advise.
        There is a lot of code reuse going on here. Thats a good thing, though it may not seem like it to you at the moment. I think you just need to install HTML::Tagset, HTML::Parser, and then HTML::Tree to get HTML::FormatText working ok. Persevere, it's not that much farther to go.

        Hmm. HTML::Parser is XS, but I don't see it in the Activestate repositories. But it is such a commonly used module, I must have something set up wrong in my (almost never used) ActivePerl.

Re: Can't locate HTML/FormatText.pm
by Anonymous Monk on May 08, 2016 at 13:40 UTC
      There should be a minus before MCPAN for me. perl -MCPAN -e shell