Assign value to four variables : Assignment Operators « Language Basics « Perl






Assign value to four variables

   

#!C:\perl\bin

$age = $myage = $herage = $hisage = 25;

print "\$age = $age\n\n";
print "\$myage = $myage\n\n";
print "\$herage = $herage\n\n";
print "\$hisage = $hisage\n\n";

   
    
    
  








Related examples in the same category

1.Using Assignment Operators on Scalar Variables
2.In Perl, an assignment itself can serve as an lvalue.
3.To set a variable, use the = operator.
4.Complex Assignment
5.Assignment Statements
6.Operating and Assigning at Once
7.Basic Math Compound Assignment Statements
8.Compound Assignment Operators
9.Assignment Operators
10.The assignment operators.
11.Examples of assignment operators.
12.Compound operator