diff options
author | Randy Stauner <rwstauner@cpan.org> | 2015-02-17 07:43:18 -0700 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2015-02-19 10:00:30 +1100 |
commit | 7b237c8f3da9b9cd57a5cbd035ff4d3e70dcbb7b (patch) | |
tree | c3bffc160462e1ab705521111b5e91bd779f9d1a | |
parent | 251758f752fa1b90bb1529735c01e7c33f0a093e (diff) | |
download | perl-7b237c8f3da9b9cd57a5cbd035ff4d3e70dcbb7b.tar.gz |
Fix minor code typos in perlunicook
-rw-r--r-- | pod/perlunicook.pod | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pod/perlunicook.pod b/pod/perlunicook.pod index 7fd8f141e3..3e5496ec0c 100644 --- a/pod/perlunicook.pod +++ b/pod/perlunicook.pod @@ -440,7 +440,7 @@ convert such strings manually. use Unicode::UCD qw(num); my $str = "got Ⅻ and ४५६७ and ⅞ and here"; my @nums = (); - while (/$str =~ (\d+|\N)/g) { # not just ASCII! + while ($str =~ /(\d+|\N)/g) { # not just ASCII! push @nums, num($1); } say "@nums"; # 12 4567 0.875 @@ -638,7 +638,7 @@ won’t fit into a byte. Here’s how to manually manage the translation: # assume $uni_key holds a normal Perl string (abstract Unicode) my $enc_key = encode("UTF-8", $uni_key, 1); my $enc_value = $dbhash{$enc_key}; - my $uni_value = decode("UTF-8", $enc_key, 1); + my $uni_value = decode("UTF-8", $enc_value, 1); =head2 ℞ 43: Unicode text in DBM hashes, the easy way |