From the course: Perl 5 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

The string concatenation operator

The string concatenation operator - Perl Tutorial

From the course: Perl 5 Essential Training

Start my 1-month free trial

The string concatenation operator

- [Voiceover] The string concatenation operator is used for combining strings. Here's a working copy of strcat.pl from Chapter Eight of the exercise files. String concatenation is very simple, two strings combined, one after the other with no separation. So when I go ahead and I run this, you'll see it says, "Hello, world," and you'll notice that there is no separation between the two words. That's because the strings are simply concatenated. One string is put right at the end of another string, and the two strings are combined without anything in between them. If you want some separation in between them, you can concatenate another string and put that separation in that other string, like that, and I can run this and now I have hello comma space world. Course, string concatenation works with more than two strings, say str three equals more and I can do the same thing here, I can put in another separator and dollar str three, and I can run that and it now says "more" at the end there.…

Contents