Binary Assignment Operators
- Almost every binary operator has an assigner
$color = "blue"; $color = $color . "-green";
- or
$color = "$color-green"; # color is now "blue-green"
- instead:
$color = "blue"; $color .= "-green";
| CPU: Perl, Fall 2005 | Perl, Week 2: Arrays, Hashes, Control Structures | #4 |
$color = "blue"; $color = $color . "-green";
$color = "$color-green"; # color is now "blue-green"
$color = "blue"; $color .= "-green";
| Copyright © 2005 Ian Langworth |