Try doing this:
#...your code...
print "Hello $name,\n ";
$secretword = $words{$name} || 'groucho';
#....more code written by you...
what this does is, if the name $name is not in your list, mexnix currently isn't, it automatically assigns "groucho" to $secretword. || is logical OR and you can find it in your
perldoc perlop manpage. With this, you can even skip the
if ($secretword eq "") { $secretword = "groucho"} stuff, because it already does it for you. My $0.02
__________________________________________________
s mmgfbs nf, nfyojy m,tr yb-zya-zy,s zfzphz,print;
- thanks japhy :)
mexnix.perlmonk.org