Are Perl strings immutable?

Viewed 2741

What's happening behind the scenes when I do a concatenation on a string?

my $short = 'short';
$short .= 'cake';

Is Perl effectively creating a new string, then assigning it the correct variable reference, or are Perl strings always mutable by nature?

The motivation for this question came from a discussion I had with a colleague, who said that scripting languages can utilize immutable strings.

3 Answers
Related