develooper Front page | perl.perl5.porters | Postings from May 2003

[PATCH pod/perlsyn.pod pod/perltrap.pod] New introduction

Thread Next
Michael G Schwern
May 13, 2003 18:33
[PATCH pod/perlsyn.pod pod/perltrap.pod] New introduction
Message ID:
The attached patch rewrites the introduction to perlsyn making it concentrate
on an overview of Perl's syntactical philosophies.  Feature comparisions
with other languages have been eliminated or moved to perltrap.  Comparisions
to other languages are now for the purposes of illustrating syntax

I've covered what I think are the most important concepts of Perl's syntax:
declarative, free-form, optional/DWIM, borrowing.  perltrap is referenced
early for users of other languages to refer to rather than scattering the
information around perlsyn.

Also, there was no explaination of comments outside the introductory
paragraph.  I moved that sentence into its own section "Comments" just
above "Simple Statements".  It might be better moved inside "Simple 
Statements".  Either way, it needs fleshing out. 

I feel it needs an additional paragraph about how Perl relates to human
languages, but don't really know how to write it.  I leave this as an
exercise for the reader. :)

I don't necessarily think of this as a final, the prose could probably be
worked on to make it friendlier and more upbeat, but its Better Than What
We Have, lays out what basically needs to be said pretty well and gives
a good platform for others to build on.  

Of course, proper grammar not known for am I.

Since the diff isn't terribly clear, here's the new opening:

       perlsyn - Perl syntax

       A Perl program consists of a sequence of declarations and
       statements which run from the top to the bottom.  Loops,
       subroutines and other control structures allow you to jump
       around within the code.

       Perl is a free-form language, you can format and indent it
       however you like.  Whitespace mostly serves to separate
       tokens, unlike languages like Python where it is an impor-
       tant part of the syntax.

       Many of Perl's syntactic elements are optional.  Rather
       than requiring you to put parenthesis around every func-
       tion call and declare every variable, you can often leave
       such explicit elements off and Perl will figure out what
       you meant.  This is known as Do What I Mean abbreviated
       DWIM.  It allows programmers to be lazy and to code in a
       style which they are comfortable.

       Perl borrows syntax and concepts from many languages: awk,
       sed, C, Bourne Shell, Smalltalk, Lisp and even English.
       Other languages have borrowed syntax from Perl, particu-
       larly its regular expression extensions.  So if you have
       programmed in another language you will see familiar
       pieces in Perl.  They often work they same, but see perl-
       trap for information about how they differ.

<GuRuThuG> make a channel called #Perl, and infest it with joking and 
           fun.... it doesnt make alot of sense.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About