Skip to content

Commit f436540

Browse files
authored
Merge pull request #55 from manwar/fix-incorrect-examples
Fixed incorrect examples in the "Introduction to Strings" section. Thanks a lot!
2 parents f3f55d6 + b2231a0 commit f436540

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

categories/cookbook/01strings/01-00introduction.pl

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,6 @@ =head2 Advanced Interpolation Control
360360
expressed in a short form, for instance q:s// can be expressed as
361361
qs//.
362362
363-
:0 :raw No escapes at all (unless otherwise adverbed)
364-
:1 :single Interpolate \\, \q and \' (or whatever)
365-
:2 :double Interpolate all the following
366363
:s :scalar Interpolate $ vars
367364
:a :array Interpolate @ vars
368365
:h :hash Interpolate % vars
@@ -375,22 +372,16 @@ =head2 Advanced Interpolation Control
375372
:t :to Interpret result as heredoc terminator
376373
377374
# Raw quoting: no escaping at all (unless otherwise adverbed)
378-
say q:raw/:raw (no interpolation) even backslash has no special meaning: \\ \/;
379-
say q:0/:0 (no interpolation) even backslash has no special meaning: \\ \/;
380-
say q0/0 (no interpolation) even backslash has no special meaning: \\ \/;
375+
say Q/(no interpolation) even backslash has no special meaning: \\ \/;
381376
382377
# Single quoting:
383378
say 'Lots of options for single quotes';
384379
say q/Lots of options for single quotes/;
385-
say q:1/Lots of options for single quotes/;
386-
say q1/Lots of options for single quotes/;
387380
388381
# Double quoting: interpolates scalars, arrays, hashes, functions,
389382
# closures, and backslash codes
390383
say "Plenty of ways to double quote too";
391384
say qq/Plenty of ways to double quote too/;
392-
say q:2/Plenty of ways to double quote too/;
393-
say q2/Plenty of ways to double quote too/;
394385
395386
# Interpolate scalars only:
396387
say q:s/The quick brown $var1 jumps over the lazy dog/;
@@ -411,8 +402,8 @@ =head2 Advanced Interpolation Control
411402
say qf/The quick brown &get_animal('quick') jumps.../;
412403
413404
# interpolate closures only:
414-
say q:c/The quick brown { return 'fox'; } jumps.../;
415-
say qc/The quick brown { return 'fox'; } jumps.../;
405+
say q:c/The quick brown { 'fox'; } jumps.../;
406+
say qc/The quick brown { 'fox'; } jumps.../;
416407
417408
# interpolate backslash codes only:
418409
say q:b/The quick brown fox\n\tJumps over the lazy dog/;

0 commit comments

Comments
 (0)