in reply to Assignment Operator

It's unfortunate that operators are so hard to search for. Search engines really ought to point you to perlintro, or perlop, both of which discuss the dot and the dot-assignment operators.

The dot operator catenates two strings:

my $foo = "bar" . "baz"; print $foo, "\n";

...prints "barbaz". The .= operator does the same thing, but assigns the new string to the scalar on the left.

my $foo = "bar"; $foo .= "baz"; print $foo, "\n";

...also prints "barbaz".


Dave