Print

Print


So, adding schwartzian transform, using the default input <>, and
making a few idiomatic perl suggestions of my own:

#!/usr/bin/perl -w
print for
    map {$_->[1]}
    sort {$a->[0] cmp $b->[0]}
    map {
        [
            (reverse $_),
            sprintf "%20s", $_
        ]
    }
    <>;


On 10/27/06, Mark J. Reed <[log in to unmask]> wrote:
> On 10/27/06, Dirk Elzinga <[log in to unmask]> wrote:
> > Since you're sorting from the end, all words  sharing a suffix will be
> > grouped together.This can be a big help if you're doing a
> > morphological analysis.
>
> Ah, morphological analysis.  That makes more sense.  (I was thinking
> maybe it was a first cut at a rhyming dictionary...)
>
>
> --
> Mark J. Reed <[log in to unmask]>
>