Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

PDF::FromHTML subroutine not found

by jonnyfolk (Vicar)
on Apr 25, 2011 at 17:26 UTC ( #901219=perlquestion: print w/ replies, xml ) Need Help??
jonnyfolk has asked for the wisdom of the Perl Monks concerning the following question:

I've installed PDF::FromHTML. On running I get Error:
Undefined subroutine &PDF::FromHTML::HAS_HTML_TIDY called at /usr/loca +l/lib/perl5/site_perl/5.8.8/PDF/FromHTML.pm line 124.
I've had a look at the source and installed all related modules. Can any one shed some light on this?

Comment on PDF::FromHTML subroutine not found
Download Code
Re: PDF::FromHTML subroutine not found
by Corion (Pope) on Apr 25, 2011 at 17:33 UTC

    A similar bug has been recorded 11 months ago.

    Looking at the source (and showing my findings...), I don't readily see what causes this behaviour. The relevant pieces of the code are:

    use constant HAS_HTML_TIDY => do { local $@; eval { require HTML::Tidy; 1 } or do { unless ( eval { require XML::Clean; 1 } ) { die( "Please install HTML::Tidy (preferred) or XML::Clean +first" ); } 0; # Has XML::Clean but no HTML::Tidy }; }; ... sub parse_file { ... if (HAS_HTML_TIDY()) { }

    It seems to me that the use constant does somehow not have the effect of declaring HAS_HTML_TIDY, but I don't see how that happens.

    Do you have HTML::Tidy installed? Also, as you seem to be running the system Perl, how did you install the module? Did you use your vendor's package manager?

      I'm running VPS and used the cpanel install service. HTML::Tidy is not installed and interestingly the install failed! I've requested installation for that.

      Your hunch turns out to be correct, thank you.

      HTML::Tidy is now installed, and the module is creating PDF. Perhaps the only 'bug' is a slightly misleading error message? :)

Reaped: Re: PDF::FromHTML subroutine not found
by NodeReaper (Curate) on May 29, 2012 at 07:36 UTC
Reaped: Re: PDF::FromHTML subroutine not found
by NodeReaper (Curate) on Jul 03, 2012 at 09:36 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://901219]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2014-07-25 02:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (167 votes), past polls