List::Compare.
http://search.cpan.org/search?query=list-compare&mode=all
-Chris
-Original Message-
From: Jim Witte [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 26, 2004 10:15 PM
To: [EMAIL PROTECTED]
Subject: Program to scan dictionary for words with letters in a
particular set?
Gi
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Jose Alves De Castro) writes:
>On Thu, 2004-05-27 at 11:21, Ramprasad A Padmanabhan wrote:
>> But to think of it there is one hitch
>>
>> suppose my string is 'god'
>>
>> Assume
>> $word = "good"
>> $r = qr/^[god]+$/
>>
>>
>> then $r would mat
On Thu, 2004-05-27 at 11:21, Ramprasad A Padmanabhan wrote:
> On Thu, 2004-05-27 at 15:09, Jose Alves de Castro wrote:
> That was simply neat. I had read in a perl book ' there is always a
> shorter way in perl '. I think this proves it.
>
> But to think of it there is one hitch
>
> suppose my s
On Thu, 2004-05-27 at 15:09, Jose Alves de Castro wrote:
> On Thu, 2004-05-27 at 06:14, Jim Witte wrote:
> > Given a file of words W such as 'cat dog at home ...' (or perhaps read
> > into an array, though that would be a very large array), and a set of
> > letters L (a string 'aoeuidhtns' - perh
On Thu, 2004-05-27 at 06:14, Jim Witte wrote:
> Given a file of words W such as 'cat dog at home ...' (or perhaps read
> into an array, though that would be a very large array), and a set of
> letters L (a string 'aoeuidhtns' - perhaps put into a array), how would
> I write a program to extract
On Thu, 27 May 2004 00:14:57 -0500, Jim Witte wrote:
> Given a file of words W such as 'cat dog at home ...'
> and a set of letters L 'aoeuidhtns'
> how would I write a program to extract all words in W whose letters
> are all in L?
Here is an overview that should get you going:
Split L with a
I think this is more of an algorithm question, not perl tho very
interesting to do it in perl.
I am not gr8 in algorithms , but this is what I will do
Write a function that will return all the letters sorted in a word
For eg for the word home , return ehmo
sub wkey {
my(@l)=sort split(//,$_[