HTML::TokeParser not able to install from CPAN - perl

I am not able to install HTML::TokeParser this package from CPAN.
cpan[6]> install HTML::TokeParser
Running install for module 'HTML::TokeParser'
Running make for G/GA/GAAS/HTML-Parser-3.71.tar.gz
Has already been unwrapped into directory /root/.cpan/build/HTML-Parser-3.71-0zUSqw
Could not make: Unknown error
Running make test
Can't test with enter code here out successful make
Running make install
Make had returned bad status, install seems impossible
Can anyone help here?

you can try:
perl -MCPAN -e 'install HTML::TokeParser'
OR
Download the zipped tar file from one of the following:
http://search.cpan.org/~gaas/HTML-Parser-3.71/lib/HTML/TokeParser.pm
or
search.cpan.org/CPAN/authors/id/G/GA/GAAS/HTML-Parser-3.71.tar.gz
Unzip the module as follows or use winzip:
tar -zxvf HTML-Parser-3.71.tar.gz
The module can be installed using the standard Perl procedure:
perl Makefile.PL
make
make test
make install # You may need to be root
make clean # or make realclean

Related

Tcl call in perl script

I am executing a Perl script that makes use of use Tcl;. This currently invokes tcl8.4.
When I check my lib path, tcl8.5 is also found. I want use Tcl; to use tcl8.5 instead of tcl8.4. Can any one help me please?
From looking at the distro's Makefile.PL, I believe it uses a tclshX.Y found when the module is installed.
If a newer version 8.5 of Tcl has been installed since you installed the module, you could try to reinstall the module.
wget https://cpan.metacpan.org/authors/id/V/VK/VKON/Tcl-1.27.tar.gz
tar xvzf Tcl-1.27.tar.gz
cd Tcl-1.27
perl Makefile.PL
make test
make install
If that isn't sufficient, this module's Makefile.PL accepts arguments that help locate the correct tclsh. As mentioned in the distro's README file, you can see the accepted options using the following:
perl Makefile.PL --help

Package all Perl module dependencies?

I've found myself on CentOS without root access, and with a very lame Perl that doesn't even have ExtUtils::MakeMaker.
Does there exist something that could produce an archive of a module's dependencies, for my to unwrap into a directory that I could put into #INC?
use App::cpanminus
cd ~/bin
curl -LO http://xrl.us/cpanm
chmod +x cpanm
export ROOT=/some/directory
export PERL5LIB=${ROOT}/lib/perl5
Then, install ExtUtils::MakeMaker and Module::CoreList. You can't do a simple installation because these modules are used by cpanm, and it doesn't look in the unpacked source directory for them. So, get cpanm to download them, and do a semi-manual install. It actually installs three distributions (the above two and ExtUtils::Install), which is why you get to invoke the build mantra three times:
PERL_MM_OPT=INSTALLBASE=$ROOT ./cpanm -L $ROOT --look ExtUtils::MakeMaker Module::CoreList
perl Makefile.PL
make && make install
exit
perl Makefile.PL
make && make install
exit
perl Makefile.PL
make && make install
exit
It unpacks and cds into each distribution's directory successively. At least that's what happens on a bare-bones CentOS 6 install I just happen to have lying around.
After that, you should be able to install your module and its dependencies via
./cpanm -L $ROOT <module name, or url, or tarball goes here>
Look at the cpanm docs for more info.
You could use perlbrew to innstall a full new Perl with user access.
http://perlbrew.pl/
#install perlbrew
wget -O - http://install.perlbrew.pl | bash
# install new perl for youurself
perlbrew install perl-5.16.0
# set aliases
perlbrew switch perl-5.16.0
#reinstall all moodules for new perl http://perlbrew.pl/Reinstall-All-Modules-On-New-Perl.html
perlbrew list-modules | perlbrew exec --with perl-5.16.0 cpanm
#how to install/recompile third party modules
https://github.com/lecstor/DevNotes/wiki/Image-Magick-with-Perlbrew
Regards,
Download and untar ExtUtils::MakeMaker, create a directory lib under your home directory, install via:
perl Makefile.PL PREFIX=~/lib LIB=~/lib
Now that module is installed I suggest you use local::lib (easy install via the bootstrap method in the documentation) to install modules:
perl -MCPAN -Mlocal::lib -e 'CPAN::install(MIME::Lite)' # Replace MIME::Lite with what you want to install.
Here MIME::Lite gets installed via cpan to your local lib directory.
Prelbrew won't take long to set up, and you likely have an easier time of things in the long run.
Edit, too long for comment.
#LeeGee Perhaps I wasn't specific enough.
The method described will allow you to get around the restricted version of perl you have access to, and allow installaton of modules to another location.
If you want to package your app on another machine you could use either PAR or pp to create a standalone package of code & modules, or a stand alone executable.
Failing that Module::ScanDeps will find a scripts dependencies

Jquery File Upload using cgi

I am new to perl scripting.I am working on drag and drop file upload and using jquery file upload.I'll appreciate if you can help me in installing this perl module and how to use it.
I am trying to follow readme file but while doing "Perl Makefile.pl" some warnings are there
Warning: prerequisite Image::Magick 0 not found.
Warning: prerequisite JSON::XS 0 not found.
Warning: prerequisite Net::SSH2 0 not found.
Warning: prerequisite Net::SSH2::SFTP 0 not found.
WARNING: Setting ABSTRACT via file 'lib/jQuery/File/Upload.pm' failed
at /usr/lib/perl5/5.8.8/ExtUtils/MakeMaker.pm line 609
Writing Makefile for jQuery::File::Upload
Writing MYMETA.yml and MYMETA.json
i am not sure if it is installed or not.
Please help me for implementation.
Thanks,
Manish
It failed or you will likely gets problems anyway, and you will likely need to install the packages mentioned in the errors. You may also need to install some ssl dev lib bits. For example on mine (Linux Mint/Ubuntu), I needed to do the following...
#edit, looks like on yours you need to install Image::Magick as well
sudo cpan JSON::XS
sudo apt-get install libssh2-1-dev
sudo apt-get install libssl-dev
sudo cpan Net::SSH2
Note: the above packages you may want to see if you can find via your package manager rather than CPAN, however the above should steer you in the right direction of the things you probably need.
then back to the README
perl Makefile.PL
make
make test
make install

running Build.PL Could not create MYMETA files

I want to install File-MimeInfo-0.16 package and run "perl Build.PL", it threw out:
Could not create MYMETA files
Creating new 'Build' script for 'File-MimeInfo' version '0.16'
Does anyone know how to fix? thanks in advance
The package that creates MYMETA.json and MYMETA.yml files is called CPAN::Meta. You can install it with one of the following:
Mac OS X: type sudo port install p5-cpan-meta in the terminal (assuming you have MacPorts installed)
Ubuntu Linux: type sudo apt-get install libcpan-meta-perl in the terminal
Other platforms: run the CPAN shell (typically by typing cpan from a terminal or command prompt), and type:
install CPAN::Meta
You can install File::MimeInfo from CPAN directly.
cpan File::MineInfo
OR, if you want to do it manually,
Install the following dependencies if you don't have them:
Carp
Exporter
Fcntl
Pod::Usage
File::Basename
File::BaseDir
File::DesktopEntry
Download the distribution
wget http://search.cpan.org/CPAN/authors/id/P/PA/PARDUS/File-MimeInfo/File-MimeInfo-0.16.tar.gz
Run the following sequence of command:
tar xvzf File-MimeInfo-0.16.tar.gz
cd File-MimeInfo-0.16
perl MakeFile.PL
make test
make install
I do not know why you want to run perl Build.PL.
But as far as installation of the module is concerned, above step will get you the module installed for sure (Provided you take care of the dependencies...OR use CPAN)
PS: Above instruction are meant for Linux platform. I have never done any perlish thing on windows.

How to install XML::Parser without expat-devel?

XML::Parser fails to build on a quite fresh 64-bit Debian box. After issuing cpan XML::Parser, cpan fails with lots of errors about Expat.c and Expat.xs:
[...]
Expat.xs:2182: error: ‘CallbackVector’ has no member named ‘skip_until’
Expat.c: In function ‘XS_XML__Parser__Expat_Do_External_Parse’:
Expat.c:2904: error: ‘XML_Parser’ undeclared (first use in this function)
Expat.c:2904: error: expected ‘;’ before ‘parser’
Expat.xs:2194: error: ‘parser’ undeclared (first use in this function)
make[1]: *** [Expat.o] Error 1
make[1]: Leaving directory `/root/.cpan/build/XML-Parser-2.41-rpV6ok/Expat'
make: *** [subdirs] Error 2
TODDR/XML-Parser-2.41.tar.gz
/usr/bin/make -- NOT OK
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
Message at the start of the output explains that expat-devel is needed for building.
Expat must be installed prior to building XML::Parser and I can't find
it in the standard library directories. Install 'expat-devel' package with your
OS package manager. See 'README'.
But expat-devel is not in Debian repository.
Is it possible to get over this without need to build/install expat from source?
The package you want to install is named libexpat1-dev. You could also just install libxml-parser-perl via apt-get. Or if you really want to install via CPAN try installing the Debian packages dependencies first via apt-get build-dep libxml-parser-perl.
libexpat1-dev contains both libexpat and expat.h, which are both mentioned in the message as well:
If expat is installed, but in a non-standard directory, then use the
following options to Makefile.PL:
EXPATLIBPATH=... To set the directory in which to find libexpat
EXPATINCPATH=... To set the directory in which to find expat.h
Installing libexpat1-dev seems to solve the problem:
$ aptitude install libexpat1-dev
There is always the manual method - to build/install expat from source.
(This example shows installing to an alternative location for XAMPP | LAMPP)
Download from:
http://sourceforge.net/projects/expat/files/expat/
tar zxf /[where-ever]/expat-2.1.0.tar.gz -C /tmp
cd /tmp/expat-2.1.0
/opt/lampp/bin/perl ./configure --prefix=/opt/lampp LDFLAGS=-L/opt/lampp/lib
make
make install
http://search.cpan.org - search for and download - XML::Parser
tar zxf /[where-ever]/XML-Parser-2.41.tar.gz -C /tmp
cd /tmp/XML-Parser-2.41
/opt/lampp/bin/perl ./Makefile.PL EXPATLIBPATH=/opt/lampp/lib EXPATINCPATH=/opt/lampp/include
make
make test
make install
Work like a charm in Ubuntu 15.04. The only thing that I need is install Perl XML Parser with:
sudo apt-get install libxml-parser-perl
And following the instructions here, I was able to import successfully all my ratings into Rhythmbox. Now, the only work that I need to do is create again the smart play lists, that is nothing compared with my entire libray ratings.
Today I had the same issue wanting to complile the new GIMP 2.9.4 beta on OSX 10.8 and the aid of homebrew.
First install perl
brew install perl
Then the XML::Parser module by going into the perl shell with
perl -MCPAN -e shell
And inside the shell install XML::Parser by typing
install XML::Parser
Exit shell
exit
Now, verify it has been installed successfully. If everything is ok, you will not see an error.
perl -e "require XML::Parser"
If the ./configure still fails missing XML::Parser, then intltools is not using the perl you have installed. Looking at the script tells me it does the test with $INTLTOOL_PERL -e "require XML::Parser". Trying a echo $INTLTOOL_PERL gave out nothing, so the magic is to set it with
export $INTLTOOL_PERL=perl
Now run ./configure again.
None of the above methods worked for me. I had the right environment variables setup but they were somehow not picked up by cpanm that I use to install perl modules. Expat was also installed.
Here is what I did to overcome the same problem that OP is reporting.
This is very close to what #LadyBuzz suggested.
Download the XML::Parser from cpan.org
Extract the tarball into directory and descend to it.
Open the Makefile.pl and edit the first lines to actually have the absolute paths to both: EXPATLIBPATH and EXPATINCPATH
Save the Makefile.pl, go up one level and create a new tarball with the Makefile.pl that you just edited.
Execute cpanm on the newly created tarball.
This resulted in successful installation of the module.