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.
Quote operators - Perl Tutorial
From the course: Perl 5 Essential Training
Quote operators
- [Voiceover] Perl provides a number of alternate quote operators. These are particularly useful in cases where normal quotes may not work easily. And you notice I run this, it says "Hello, World" in the output. Now let's say that I didn't wanna use the quote marks for whatever reason, and we'll talk about reasons in a minute. Instead, I could use the letter Q and a pair of matching characters. So I can use an opening parenthesis here and a closing parenthesis here, instead of the closing quote mark, and save and run, and you'll notice that the output is exactly the same. So what are some reasons that I might wanna do this? Perhaps I wanted to use regular quote marks inside of the string, and so if I do that, now our output says "Hello, World" with the quotes. But if I were to try that with the regular quote marks, I would get an error about a Bareword. Missing operator before World. So that doesn't work. So instead, I can use these alternate quote marks like this, and the output is…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
(Locked)
About Perl's operators2m 35s
-
(Locked)
Basic arithmetic operators5m 30s
-
(Locked)
Compound assignment operators2m 5s
-
(Locked)
Relational operators3m 27s
-
(Locked)
Logical operators6m 1s
-
(Locked)
File test operators3m 42s
-
(Locked)
The range operator2m 54s
-
(Locked)
The string concatenation operator1m 31s
-
(Locked)
Quote operators4m
-
(Locked)
-
-
-
-
-
-
-
-