Online Programming Reference Guides - Perl
[an error occurred while processing this directive]
Contents
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]
[an error occurred while processing this directive]

2.4.5 Assignment with Operators

It should be duly noted that it is possible to concatenate, like in C, an operator onto the assignment statement to abbreviate using the left hand side as the first operand. For example,

use strict; my $greet = "Hi! "; $greet .= "Everyone\n"; $greet = $greet . "Everyone\n"; # Does the same operation # as the line above

This works for any simple, binary operator.





[an error occurred while processing this directive]