Built-in Operators
Arithmetic Operator :
+ Addition
- Subtraction
* Multiplication
/ Division
Unary Operator :
++$a, $a++ Auto increment
--$a, $a-- Auto decrement
Numeric Comparison :
== Equality
!= Inequality
<> Greater Than
<= Less Than or Equal >= Greater Than or Equal
String Comparison :
eq Equality
ne Inequality
lt Less Than
gt Greater Than
le Less Than or Equal
ge Greater Than or Equal
N.B.: There are no special variable types in Perl. But Perl needs to know whether to sort numerically (where 99 is less than 100) or alphabetically (where 100 comes before 99).
Boolean Logic :
&& and
|| or
! not
Miscellaneous :
= Assignment
. String concatenation
x String multiplication**
.. Range operator
** Here multiplication operator is also called the repeat operator. Again, it's a separate operator (x) to keep it distinct from numeric multiplication.
Some examples to remove confusion:
$a = 123;
$b = 456;
print $a + $b; # prints 579
print $a . $b; # prints 123456
$a = 123;
$b = 3;
print $a * $b; # prints 369
print $a x $b; # prints 123123123
The following operators are also available in Perl
$a += 1; # same as $a = $a + 1
$a -= 1; # same as $a = $a - 1
$a .= "\n"; # same as $a = $a . "\n";
Help Links:
http://www.perl.com/pub/2000/10/begperl1.html
http://perldoc.perl.org/perlintro.html
http://www.perl.org/learn.html
http://learn.perl.org/books.html
http://learn.perl.org/tutorials/
http://www.perl.com/pub/2008/04/23/a-beginners-introduction-to-perl-510.html
http://docstore.mik.ua/orelly/perl2/prog/ch01_05.htm
http://www.tizag.com/perlT/perluserinput.php
http://www.tizag.com/perlT/perlchomp.php
http://perldoc.perl.org/functions/use.html
http://www.well.ox.ac.uk/~johnb/comp/perl/intro.html
http://www.sthomas.net/roberts-perl-tutorial.htm/ch22/use_strict_
http://docstore.mik.ua/orelly/perl/prog3/ch31_19.htm
http://debugger.perl.org/580/perldebtut.html
http://perldoc.perl.org/strict.html
. . . . . To be continued . . . . .
Saturday, March 5, 2011
Subscribe to:
Post Comments (Atom)
Popular Posts
-
.:: DNS Server ::. The Domain Name System (DNS) is a hierarchical naming system built on a distributed database for computers, servic...
-
.:: Web Server ::. A web server can be referred to as either the hardware, the computer or the software, the computer application that...
-
The full process is tested on the computer with following configuration: Processor: Core i3 2.53 GHz RAM: 2.00 GB OS: 32-bit Windows...
Excellent tutorial for the beginners.
ReplyDeleteGo ahead!!!!!!!!!!!!!!!!
The Resource is not enough for me...need more and more... (Array and Function and Matrix related topics should be better).
ReplyDeleteEverything here is for novice user of Perl. Array and function (subroutine) are also described here. For more detais you may use the help links or google it. It's ur task to improve urself. Thanks
ReplyDelete