Perl conti.....

From DrugPedia: A Wikipedia for Drug discovery

(Difference between revisions)
Jump to: navigation, search
Current revision (04:05, 8 September 2008) (edit) (undo)
 
(One intermediate revision not shown.)
Line 16: Line 16:
'''PERL - Assignment Operators'''
'''PERL - Assignment Operators'''
 +
Addition ($x += 10)
Addition ($x += 10)
Line 34: Line 35:
Logical operators state and/or relationships. Meaning, you can take two variables and test an either or conditional. Logical operators are used later on in conditionals and loops. For now, just be able to recognize them in the upcoming examples.
Logical operators state and/or relationships. Meaning, you can take two variables and test an either or conditional. Logical operators are used later on in conditionals and loops. For now, just be able to recognize them in the upcoming examples.
-
==,eq 5 == 5
+
==, eq   5 == 5
-
5 eq 5 Test: Is 5 equal to 5? True
+
5 eq 5   Test: Is 5 equal to 5? True

Current revision

Arithmetic Operators:

Arithmetic operators are symbols used to execute general arithmetic procedures including: addition (+), subtraction (-), multiplication (*), and division (/).

7 + 7 = 14 Addition

7 - 7 = 0 Subtraction

7 * 7 = 49 Multiplication

7 / 7 = 1 Division

7 ** 7 = 823543 Exponents

7 % 7 = 0 Modulus

PERL - Assignment Operators

Addition ($x += 10)

Subtraction ($x -= 10)

Multiplication ($x *= 10)

Division ($x /= 10)

Modulus ($x %= 10)

Exponent ($x **= 10)

PERL - Logical & Relational Operators

Relationship operators compare one variable to another. (5 < 12) They are used to compare equality or inequality of two or more variables, be it a string or numeric data.

Logical operators state and/or relationships. Meaning, you can take two variables and test an either or conditional. Logical operators are used later on in conditionals and loops. For now, just be able to recognize them in the upcoming examples.

==, eq 5 == 5

5 eq 5 Test: Is 5 equal to 5? True