Relational and Logical Operators in PERL

Relational and Logical Operators in PERL

All programming languages have Relational and logical operators. Lets discuss on what Perl has as relational & logical operators.
  • The relational & logical operators are used with conditional statements and looping statements.
  • Perl’s relational and logical operators are same as C language and shell script.
  • All operators’ returns true if the condition satisfies else return False.
Relational operators
The C way
The shell script way
Description
>
gt
Greater than
<
lt
Less than
>=
ge
Greater than equal to
<=
le
Less than equal to
==
eq
Equals
!=
ne
Not equal
Logical operator
The C way
Description
&&
and operator
||
or operator
!
not operator
Other file operations
Operators
Description
-e filenameFile exist
-f filenamePlane file
-d filenameDirectory
-s filenameFile size not zero
-r filenameFile readable
-w filenameFile writable
-x filenameFile executable

Comments

HTML/JAVASCRIPT

Popular posts from this blog

Teradata SQL Assistant Shortcuts

How to List All Tables in Oracle, MySql, Teradata, DB2 and PostgreSQL

7473 Requested sample is larger than table rows. All rows returned