- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Perl Assignment Operators
Assume variable $a holds 10 and variable $b holds 20, then below are the assignment operators available in Perl and their usage −
Sr.No. | Operator & Description |
---|---|
1 | = Simple assignment operator, Assigns values from right side operands to left side operand Example−$c = $a + $b will assigned value of $a + $b into $c |
2 | += Add AND assignment operator, It adds right operand to the left operand and assign the result to left operand Example−$c += $a is equivalent to $c = $c + $a. |
3 | -= Subtract AND assignment operator, It subtracts right operand from the left operand and assigns the result to left operand Example−$c -= $a is equivalent to $c = $c - $a |
4 | *= Multiply AND assignment operator, It multiplies right operand with the left operand and assigns the result to left operand Example−$c *= $a is equivalent to $c = $c * $a. |
5 | /= Divide AND assignment operator, It divides left operand with the right operand and assign the result to left operand Example−$c /= $a is equivalent to $c = $c / $a |
6 | %= Modulus AND assignment operator, It takes modulus using two operands and assigns the result to left operand Example−$c %= $a is equivalent to $c = $c % a |
7 | **= Exponent AND assignment operator, Performs exponential (power) calculation on operators and assign value to the left operand Example−$c **= $a is equivalent to $c = $c ** $a |
Advertisements