I list below all topic groups, which I have done according to subjects, which they handle. You can return to this topic group by using this menu and the link Table of topic groups on the top of the each page.
| |||||||||||||||||||
![]() | Table of topic groups > Front page of help pages > Help pages > 7. Help for Perl menu |
|---|
I have tried to learn WAP technology and Perl is common used CGI-language in WAP Servers. That's why I want to understand it. I have read about it from the book Inside WAP (a Finnish book), Pekka Niskanen, a worker of Acta Systems Oy (IT Press, 2000) and WWW Kehittäjän opas, Jouni Santara (Satku, 1996).
Acta Systems Oy, IT Press, Satku: Perl examples.My examples base on the used books, but I have translated Finnish words into English. If you are a Finnish user of my plugins, I recommend to borrow or buy this book. If you understand only English, try to find some web pages or English books to learn principles of Perl.
This page is primary my personal help file to the Perl plugins menu, which is from the creators of HTML-Kit. I forgot some matters and I need some notes. In fact this is an additional Help for TM WML plugins menu.
Perl, Java and C++ share a subset of
C syntax. C was first, C++ was built on top of that.
Perl borrowed C and some C++ syntax and from some
Unix tools (awk, sed,
grep, Bourne shell). Then Java borrowed
mostly C++ syntax but also some Perl syntax. Today people use PHP, which base partially on Perl. Many people regard it simler and I use it. I have among my CSS-pages a page for PHP
.
I have made only some Java-servlets. Java and Perl has many divergent features, which I must list in order to remember them (they are difficult to remember and cause confusions). Here is a list of some features, which are good to remember:
$_ = default variable, which is not necessary to
write@ + name = array variable like
@table% + name = associative
hash table, which is a list of name + value pairs like in this
example:
%colors = ('red', 0x00f, 'blue', 0x0xf0,
'green', 0xf00)
$colors('red') # refer to the value
'0x00f'
@ARGV = an array from the command interpreter
variables$ENV = environment variable%ENV = environment hash table=~ = the binding operator, which return true if
the lines have exactly the same like $row =~
/>card/class_library::class = use classes from a
library file.<> = the hook
operator, which include a name like <NAME>. An
example:
open (FILE, "$_[0])
while (<FILE>)
$in_line = $_;...
<,>, >>
with hooks. Look an example:
open (FILE, <data.txt) # open the
file
open (FILE, >data.txt) # write to the file and replacing
the existing data
open (FILE, >>data.txt) # write to the end of the
file
STDIN, STDOUT and
STDERR are standard hooks handles.^ = an anchor, which limits the searching, for
example /^#/ = the searching is passed if the line
begins with a # mark.-> = the reference operator, which refer to
the properties of certain classeslt = less than (<)le = less than or equal
(<=)gt = greater than (>)ge = greater than or equal
(>=)eq = equal (==)ne = not equal (!=)cmp = if the left operand is greater, then 1; if
equal, then 0; if the right operand is greater, then -1
(<=>). = a sign to concatenate strings that means to
put together strings and string variables (in C++ and Java is
used +)
sub = subroutine, which works like in this
example:
# a definition of some sub
application
sub my_sub { # no formal parameter list
# my $first_parameter=$_[0]; is according to the
book
# one person said, that the following format is
better:
my($first_parameter)=$_[0];" # these can be used with array
tables
my($second_parameter)=$_[1];
}
# a call of some sub application
&my_sub($param1, $param2, $param3); # this the old
syntax
# &
is no longer required
[$[] = the first element in an array[$#array] = the last element in an array$ and using the get
method ?.