3 # Using a Schwartzian Transform, read a list of words and sort them in
4 # "dictionary order." Dictionary order ignores all capitalization and
5 # internal punctuation. Hint: The following transformation might be useful:
7 # my $string = 'Mary Ann';
8 # $string =~ tr/A-Z/a-z/;
9 # $string =~ tr/a-z//cd;
12 # Be sure you don't mangle the data! If the input includes 'the Professor'
13 # and 'The Skipper', the output should have them listed in that order, with
14 # that capitalization.
21 chomp(my @lines = <>);
25 sort { $a->[1] cmp $b->[1] }
32 print join "\n", @sorted;