diff options
| author | Abigail <abigail@abigail.be> | 2021-01-09 21:31:35 +0100 |
|---|---|---|
| committer | Abigail <abigail@abigail.be> | 2021-01-09 21:57:52 +0100 |
| commit | 67a06243a81dbc68d16ef92db92488d783b49522 (patch) | |
| tree | f6c16b09cf28d80a4ce7aea2ff262f20f9ee2974 /challenge-094 | |
| parent | baead4f7da7e805466f6961bf24531f0190e7fbe (diff) | |
| download | perlweeklychallenge-club-67a06243a81dbc68d16ef92db92488d783b49522.tar.gz perlweeklychallenge-club-67a06243a81dbc68d16ef92db92488d783b49522.tar.bz2 perlweeklychallenge-club-67a06243a81dbc68d16ef92db92488d783b49522.zip | |
Add some notes.
But in a disclaimer you may get unexpected results if the input contains
accented letters and/or combining characters. We're blaming the
specification.
(Or lack thereof).
Diffstat (limited to 'challenge-094')
| -rw-r--r-- | challenge-094/abigail/perl/ch-1.pl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/challenge-094/abigail/perl/ch-1.pl b/challenge-094/abigail/perl/ch-1.pl index bccd80afaa..c2fd0ddf8a 100644 --- a/challenge-094/abigail/perl/ch-1.pl +++ b/challenge-094/abigail/perl/ch-1.pl @@ -19,6 +19,10 @@ while (<>) { foreach my $word (/"([^"]+)"/g) { # # Normalize each word: split into characters, sort them, join them. + # Note that we're splitting on characters, not graphemes, nor + # do we normalize the input. This may lead to unexpected results + # when using accented letters and/or combining characters. But + # that's what you get when using poor specifications. # my $normalized = join "" => sort split // => $word; push @{$anagrams {$normalized}} => $word; |
