Perl
basics
About
PERL
Perl is
the Swiss Army chainsaw of scripting languages: powerful and adaptable. It was
first developed by Larry Wall, a linguist working as a systems administrator
for NASA in the late 1980s, as a way to make report processing easier. Since
then, it has moved into a large number of roles: automating system
administration, acting as glue between different computer systems; and, of
course, being one of the most popular languages for CGI programming on the Web.
Why did
Perl become so popular when the Web came along?
Two
reasons:
First,
most of what is being done on the Web happens with text, and is best done with
a language that's designed for text processing. More importantly, Perl was
appreciably better than the alternatives at the time when people needed something
to use. C is complex and can produce security problems (especially with
untrusted data), Tcl can be awkward and Python didn't really have a foothold.
It also
didn't hurt that Perl is a friendly language. It plays well with your personal
programming style. The Perl slogan is ``There's more than one way to do it,''
and that lends itself well to large and small problems alike.
In this
first part of our series, you'll learn a few basics about Perl and see a small
sample program.
A Word
about Operating Systems
use a UNIX
system preferably ,your Perl interpreter is located at/usr/local/bin/perl. fine when running Windows; most Perl code is platform-independent.
Your
First Perl Program
Take the following text and put it into a file called first.pl:
#!/usr/local/bin/perl
print
"Hi there!\n";
(Traditionally, first programs are supposed to say Hello
world!, but I'm an iconoclast.)
Now, run it with your Perl interpreter. From a command line, go to
the directory with this file and type perl first.pl. You should see:
Hi there!
The \n indicates the ``newline'' character; without it, Perl doesn't skip to a new line of text on its own.
Perl
Online Training, Perl Scripting online training by real time Experts from
Hyderabad, India. Call us +919000444287 for online training demo.
Online Perl
training institute in India, online Perl Scripting training institute in
Hyderabad.
for any Quires mail us at contact@21cssindia.com
for any Quires mail us at contact@21cssindia.com
For more
info
No comments:
Post a Comment