RE: Perl Programming within Debian
rocky wrote:
> I'm thinking of learning Perl Programming.
Get this book first, read it, and do all of the exercises:
http://www.oreilly.com/catalog/learnperl4/index.html
After that, get these books as references:
http://www.oreilly.com/catalog/pperl3/index.html
http://www.oreilly.com/catalog/perlckbk2/index.html
For CGI scripting, this is the classic:
http://www.wiley.com/legacy/compbooks/stein/
but it is dated. I'm working through it and writing updated scripts:
http://apache.holgerdanske.com/cgi-pm-book/
I have some others, but haven't studied them in a while.
> Can any of you help me get started on how to programming Perl in
> Debian?
Install these Debian packages (as root):
# apt-get perl-doc
# apt-get perlindex
Then use the perlindex program to browse the documentation (as a user):
$ perlindex learn
> I mean what is the file extension for the perl? Is it .cgi?
For command-line scripts, I don't use any extension so that they are
invoked just like any other command-line program.
For CGI scripts, I use .cgi for CGI scripts that run in the traditional
CGI way and .pl for CGI scripts run with mod_perl Apache::Registry
acceleration (the later is 10x faster, but there are subtle differences
that break some scripts and I haven't figure out all the details yet).
> Do I need to use any compiler for perl? what is the best choice?
A standard Debian installation includes the Perl interpreter:
2006-12-30 09:32:09 dpchrist@p3600 ~
$ perl -v
This is perl, v5.8.4 built for i386-linux-thread-multi
...
which includes the Perl debugger (-d command line option).
> How can I test my work(For instance in PHP programming I can use
> Firefox browse to the file I want to see the output)?
For command-line scripts, you can run them from the command line with or
without the debugger.
For CGI scripts, you can run them as above and/or have your web server
run them. The web server can either call the command-line Perl
interpreter, load a Perl interpreter module (mod_perl), or have a Perl
interpreter already compiled in. I prefer the last choice:
apt-get apache-perl
> I was trying to search on the net and it did give me lots of results.
Yup. I'd recommend starting here:
http://www.perl.org/
FYI the best place for asking Perl language questions is the usenet
newsgroup:
comp.lang.perl.misc
and for Perl CGI questions:
comp.infosystems.www.authoring.cgi
HTH,
David
Reply to: