develooper Front page | | Postings from April 2002

RE: Please explain

Thread Previous | Thread Next
Stephen Turner
April 8, 2002 14:08
RE: Please explain
Message ID:
On Mon, 8 Apr 2002, Mark Schoonover wrote:

> --=={First, sort puts its arguments into list context.
> Cool so far...
> --=={This is then sorted by the
> --=={sort, and two words are anagrams if and only if they agree 
> --=={about their sorted letters.
> Huh?? This is the part that tripped me up. I don't understand how it knows
> if the new words are valid words.

Valid words? The sorted words aren't valid words, if that's what you mean.
But, for example, you can tell elvis and lives are anagrams, because for
each of them sort/./g is (e, i, l, s, v).

Stephen Turner, Cambridge, UK
"This is Henman's 8th Wimbledon, and he's only lost 7 matches." BBC, 2/Jul/01

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About