Perl conti.....

From DrugPedia: A Wikipedia for Drug discovery

Revision as of 10:53, 3 September 2008 by Arun (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

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