[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Perl Programming within Debian



On Sat, Dec 30, 2006 at 08:06:51AM -0800, rocky wrote:
> Hey all,
> 
> I wish all of you a Happy New Year!
> 
> I'm thinking of learning Perl Programming. Can any of you help me get
> started on how to programming Perl in Debian? 
Hi Rocky,
welcome to the world of fun! At this point you can learn Bash, perl,
ruby, python or php, all with the same amount of ease. 
> I mean what is the file extension for the perl?
perl is an interpreted language as oppose to a compiled one like C.
you just edit a text file and give it to the perl interpreter:
-------------------------------
vi myfirstperlscript.txt
perl myfirstperlscript.txt
-------------------------------
there technical is not need for an 'extension' (ala MSDOS). But the
popular convention is to use '.pl'.

> Is it .cgi? Do I need to use any compiler for
> perl? what is the best choice?
To begin, you will need the basic perl setup which is part of all Gnu
systems. As you progress, you may need more functions.
> 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)?
If you just write a basic perl program that is part of a web server, you
just go to the console and run it like this:
-------------------------------
perl myprogram.pl
-------------------------------
> 
> I was trying to search on the net and it did give me lots of results.
> But because I'm in China and due to the earthquake took place in Taiwan
> which very badly damaged the network, most of the webpages could not
> loaded. Thanks to the google, which its servers are scattered all over
> the world. Get help through google group is my only way now.
Oh well, hope that get fixed.
if the meanwhile, the best thing to do is find some tutorial from google
and to find a simple project that you want to do as a way to try out
your new skills. One more thing: on unix systems, the first line of any
program is setup a certain way:
for perl, this is:
#!/usr/bin/perl
for bash, this is:
#!/bin/bash

Here is a simple program:
-------------------------------
#!/usr/bin/perl
use warnings;
use strict;
print "Hello World!\n"
-------------------------------
the 2 'use' lines are very important to use to make sure that you
program well.
cheers,
Kev
-- 
|  .''`.  == Debian GNU/Linux == |       my web site:       |
| : :' :      The  Universal     | debian.home.pipeline.com |
| `. `'      Operating System    | go to counter.li.org and |
|   `-    http://www.debian.org/ |    be counted! #238656   |
|     my keysever: pgp.mit.edu   |     my NPO: cfsg.org     |

Attachment: signature.asc
Description: Digital signature


Reply to: