Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
That code, while it found the main code error, will still
sometimes show the error message.
If $name is not found in the hash %words, then $secretword will be undefined and will produce the error mentioned when used as if defined. If you however test for the definedness of $secretword you will be closer to the original aim.
In perl style I'd probably write: $secretword = $words{$name} || 'stupid'; But that is a matter of choice. In reply to Re: Re: HElp on program
by repson
|
|