Showing posts with label perl. Show all posts
Showing posts with label perl. Show all posts

Thursday, June 11, 2009

Installing CPAN modules in perl in linux.

Perl support lots of in built module available under CPAN [Comprehensive Perl Archive Network] which can be install by the following command.

uttam@uttam:/ sudo perl -MCPAN -e shell

after this command you'ill be under cpan shell and you'll see the following text on screen..

cpan shell -- CPAN exploration and modules installation (v1.9205)
ReadLine support available (maybe install Bundle::CPAN or Bundle::CPANxxl?)

cpan[1]>

Now you can install module you want with perl.for example you can type "install DBI" to install DBI modules.

After successful installation you can view the DBI directory under following folder.
/usr/local/lib/perl/5.10.0/.

Thursday, May 28, 2009

running perl script in apache

Perl script can be run as executable files in apache.All you have to do is to follow some basic steps given below.

open your apache.conf file in write mode and add the following line.by default it's under /etc/apache2/ directory.

AddHandler cgi-script .cgi .pl

save the file.

Next, search for the line that says " in the file. It should look something like this:[In this case /var/www/ is the document root.]


Options FollowSymLinks
AllowOverride None


Add "+ExecCGI" to the options list. The line now looks like this:
Options FollowSymLinks +ExecCGI

generally you can find this in sites-enabled/000-default file.

Restart your apache web server.

test by typing URL of your perl script in web browser.