skip to content

Perl

How to Install a Perl Module at a Custom Location

If you don't have permission to install a Perl module into the system Perl directories, you will not be able to use CPAN or yum or atp-get etc to install the module. You have to manually install it. Here are the steps:

  1. Download the module's package from search.cpan.org
  2. Install the package:

    $ tar zxf module-name.tgz
    $ cd module-name
    $ perl Makefile.PL PREFIX=/your-custom-dir
    $ make
    $ make test
    $ make install

HTML::Encoding Dependencies

The locale library for at least utf-8 must be compiled before we attempt to install HTML::Encoding.

On Gentoo, we run "locale-gen" to compile the locales, after we have setup the locale options follow the notes at the bottom of Installing the Gentoo Base System.

On Red Hat/CentOS, we run "localedef" to compile definition files. For instance, you can do "localedef -c -f UTF-8 -i en_US en_US.utf8" to compile utf-8 of en_US.

Fix HTML::Tidy libtidy Dependency

To use HTML::Tidy, we must first make sure the libtidy is installed in the system. Otherwise, when you try to install it via cpan, it will give you compilation error.

On Gentoo, in order to install it from cpan, you must make sure you have "emerge -v app-text/htmltidy".  Or better, just directly "emerge -v dev-perl/perltidy" and that should take care of everything for you, I think.

How to Silent the Warning of "Parsing of undecoded UTF-8 will give garbage when decoding entities at ..."

When we use the LWP to parse a page that is UTF-8 encoded, we get a warning of "Parsing of undecoded UTF-8 will give garbage when decoding entities at /usr/share/perl5/LWP/Protocol.pm line 114". This is documented in HTML::Parser's manual.

A simple way to get around this is to silent the warning like this:

Perl 6 on the Way

When I attended a seminar by Damian Conway on 2005, he told us they expected to release Perl 6 the next year. Two more years later, I started to wonder, where is it?

Looks like it is coming. Check out this site Official Perl 6 Wiki, and you will see that it is going along just fine. There is even a CPAN6.

.vimrc Tips

 The global vimrc files are located in /etc/vim/.

For Drupal programmers, you can add this line to make vim recognize *.module files are PHP:

Setup cgi-bin Access on Lighttpd

Turn on mod_alias and mod_cgi

To setup cgi-bin access, you have to enable both the mod_alias and mod_cgi in /etc/lighttpd/lighttpd.conf:

server.modules += ( "mod_alias" )

include "mod_cgi.conf"

Setup cgi-bin access in localhost

Lighttpd installation came with a mod_cgi.conf in /etc/lighttpd. Check that file to make sure that it has:

Syndicate content
Powered by Drupal.