in reply to HElp on program

You're running into a common difficulty for newer programmers. Here are some good rules of thumb to keep in mind: That's not exactly comprehensive, but it usually holds. For example, when you had the following line:
$secretword=$words{$name};
The curly braces should indicated that you were expecting "words" to be a hash. So, when you have a problem, you go back and look at how words is defined. In this case, it's declared as an array with the @ symbol.

If you had use strict at the top of your program, you would have received a fatal error for trying to access a "words" hash that was undeclared. Actually, you would have gotten errors earlier when you tried to assign elements to the @words array. I know that's not covered right away in the book you are using, but it's a good practice to get into (along with using warnings, the -w switch). Using strict and warnings will save you many hours of debugging and, in this case, an error would have occured long before it did, thus allowing you to have a better idea what's actually causing the error.

Unfortunately, the above information is a very simplistic treatment of the issues, but it's some good stuff to always keep in mind when you are first starting out.

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.