Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

HTML::Tidy on Linux

by jai_dgl (Beadle)
on Sep 17, 2008 at 14:56 UTC ( #712020=perlquestion: print w/ replies, xml ) Need Help??
jai_dgl has asked for the wisdom of the Perl Monks concerning the following question:

Need to install HTML::Tidy in Linux environment. I'm using RHL 4 and perl v5.8.5.
I tried to install using perl -MCPAN -e "install HTML::Tidy"
............ Looks good Note (probably harmless): No library found for -ltidy Writing Makefile for HTML::Tidy cp lib/HTML/Tidy/Message.pm blib/lib/HTML/Tidy/Message.pm cp lib/HTML/Tidy.pm blib/lib/HTML/Tidy.pm /usr/bin/perl /usr/lib/perl5/5.8.5/ExtUtils/xsubpp -typemap /usr/lib/ +perl5/5.8.5/ExtUtils/typemap Tidy.xs > Tidy.xsc && mv Tidy.xsc Tidy. +c gcc -c -I. -I/usr/include/tidy -I/usr/local/include/tidy -I/sw/includ +e/tidy -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -p +ipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 - +I/usr/include/gdbm -O2 -g -pipe -m32 -march=i386 -mtune=pentium4 -D +VERSION=\"1.08\" -DXS_VERSION=\"1.08\" -fPIC "-I/usr/lib/perl5/5.8.5/ +i386-linux-thread-multi/CORE" Tidy.c Tidy.xs:5:18: tidy.h: No such file or directory ............

Is there any installation procedure ?
Thanks
Jey

Comment on HTML::Tidy on Linux
Download Code
Re: HTML::Tidy on Linux
by Corion (Pope) on Sep 17, 2008 at 15:03 UTC

      Just as a note: That link just gets you a text file that says 'use CVS'.

      Which is no help whatsoever behind my work firewall.

Re: HTML::Tidy on Linux
by dwm042 (Priest) on Sep 17, 2008 at 15:25 UTC
    Jey,

    I would check and see if the package is part of the native distribution. I know for a fact an HTML Tidy package (binary) is part of Ubuntu. I just found one for Fedora. And there appears to be a source package for RHEL4. In these distributions you're better off using the code the distribution provides.

    Sincerely,

    David.
Re: HTML::Tidy on Linux
by AZed (Monk) on Sep 17, 2008 at 19:53 UTC

    Note that distributions may actually split libtidy into two parts — what you need for runtime, and what you need for development. If you find a libtidy RPM package, you may also still need to search for a libtidy-dev package as well to get the headers you need to compile with.

    As an aside, I had zero luck using HTML::Tidy. On my Debian system, it segfaulted as soon as I fed it a configuration option. I ended up writing my own system tidy wrappers for the project I'm currently working on (a set of ebook-related tools). Here's one of them, as an example for the curious:

    # # sub system_tidy_xhtml($infile,$outfile) # # Runs tidy on a XHTML file semi-safely (using a secondary file) # Converts HTML to XHTML if necessary # # Arguments: # $htmlfile : The filename to tidy # # Global variables: # $tidycmd : the location of the tidy executable # $tidyconfig : the location of the config file to use # $tidyxhtmlerrors : the filename to use to output errors # $tidysafety: the safety factor to use # # Returns the return value from tidy # Dies horribly if the return value is unexpected # # Expected return codes from tidy: # 0 - no errors # 1 - warnings only (leave errorfile) # 2 - errors (leave errorfile and htmlfile) # sub system_tidy_xhtml { my $infile; my $outfile; my @configopt = (); my $retval; ($infile,$outfile) = @_; die("system_tidy_xhtml called with no input file") if(!$infile); die("system_tidy_xhtml called with no output file") if(!$outfile); @configopt = ('-config',"$datapath/$tidyconfig") if(-f "$datapath/$tidyconfig"); $retval = system($tidycmd,@configopt, '-q','-utf8', '-asxhtml', '--doctype','transitional', '-f',$tidyxhtmlerrors, '-o',$outfile, $infile); # Some systems may return a two-byte code, so deal with that first if($retval >= 256) { $retval = $retval >> 8 }; if($retval == 0) { rename($outfile,$infile) if($tidysafety < 4); unlink($tidyxhtmlerrors); } elsif($retval == 1) { rename($outfile,$infile) if($tidysafety < 3); unlink($tidyxhtmlerrors) if($tidysafety < 2); } elsif($retval == 2) { print STDERR "WARNING: Tidy errors encountered. Check ",$tidyxhtm +lerrors,"\n" if($tidysafety > 0); unlink($tidyxhtmlerrors) if($tidysafety < 1); } return $retval; }
Re: HTML::Tidy on Linux
by mr_mischief (Prior) on Sep 18, 2008 at 14:38 UTC
    Please be clear and precise about what operating system distribution you are using.

    Red Hat Enterprise Linux 4 is usually abbreviated as "RHEL 4" or "RHEL4", and not "RHL 4".

    In case you weren't aware, "Red Hat Linux" already had nine major versions and was subsequently spun off as Fedora Core 1, which is now simply Fedora and is up to version 10. Red Hat Enterprise is a quite different distribution with quite different focus and support options. I very seriously doubt you're using Red Hat Linux 4, released about twelve years ago and using the Linux 2.0.x series of kernels, but that's what I read in your node.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2014-07-26 09:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (175 votes), past polls