Skip to content

Commit 23e29cc

Browse files
committed
Add example into Unicode tutorial
1 parent b15f493 commit 23e29cc

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

Diff for: unicode-introduction.pod

+11-5
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Unicode table.
9797

9898
binmode STDOUT, ":encoding(UTF-8)";
9999

100-
say ''
100+
say '';
101101

102102
__TEST__
103103
like($code, qr|\\x{[0-9a-f]+?}|i, '\x{} notation should be used');
@@ -131,7 +131,7 @@ B<Hint>: use Unicode B<NOT SIGN>.
131131

132132
binmode STDOUT, ":encoding(UTF-8)";
133133

134-
say ''
134+
say '';
135135

136136
__TEST__
137137
like($code, qr|\\N{[ A-Z]+?}|, '\N{} notation should be used');
@@ -158,16 +158,22 @@ script as UTF-8 text file. Watch this:
158158
say "$k note is $v";
159159
}
160160

161-
Even more, you can use Unicode symbols in your indentifiers!
161+
Even more, you can use Unicode symbols in your indentifiers
162162

163163
use utf8;
164164

165-
binmode STDOUT, ":encoding(UTF-8)";
166-
167165
my $cliché = 42;
168166

169167
say "The answer is $cliché!";
170168

169+
and inside regular expressions!
170+
171+
use utf8;
172+
173+
my $snowman = "Hello, I'm \x{2603}.";
174+
175+
say 'Snowman is here!' if $snowman =~ /☃/;
176+
171177
=head4 Exercise
172178

173179
Edit this piece of code by filling internationalized country code

0 commit comments

Comments
 (0)