Examples of mentioned solutions:
- $data = $data . $more;
- $data .= $more;
- substr($data, length($data), 0, $more);
- substr($data, length($data)) = $more;
- $data = join('', $data, $more);
- $data =~ s/\z/$more/;
- $data =~ "$data$more";
- { open(my $fh, '>+', \$data); print $fh $more; } (Requires 5.8)
Other useful solutions:
- $data = sprintf('%s%s', $data, $more);
- $data = pack('a*a*', $data, $more);
- $data = pack('(a*)*', $data, $more); (Requires 5.8)
- $data = do { local $"; my @array = ($data, $more); "@array" };
Other text formatting functions:
- format formats text sent to a file handle.
- formline is the guts of format.
And that's only using tools meant for text manipulation and/or formatting. You could do weird stuff like:
- $data = reverse scalar reverse $data, $more;
- $data = do { local $;; my %hash; $hash{$data, $more}++; (keys(%hash))[0] };