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.

Character strings

Character strings - Perl Tutorial

From the course: Perl 5 Essential Training

Start my 1-month free trial

Character strings

- [Voiceover] In Perl, a String value is one that can be represented as a string. So here's a working copy of hello.pl, from Chapter 4 of the Exercise Files. And if I Save and Build and Run, you see it says, "Hello, World!" I'm gonna come down here, and I'm gonna change this. Instead I'm going to say, my dollar S equals "Hello, World!" And say, S is, and I'm gonna put dollar S in square brackets here so that we can see the boundaries of the String when we display it. And so I'm gonna Save and Run, and you can see it says, S is "Hello, World," and "Hello, World," with a comma and the exclamation point is inside those square brackets so we can see where the boundaries of the String are. This helps us in circumstances like if I were to put a space in here, Save and Run, see, that space shows up and we can see the space clearly because we have the brackets around the variable. So this is a String variable because it can be represented as a string. And so I can treat it as a string, and I…

Contents