in reply to Re: Good practice: Variable declaration
in thread Good practice: Variable declaration

Ouch. Remove those extra $word ='s. Not only are they assigning to a package-scoped $word, they're screwing up your ?: code. And you have a ":" where you want a "?", beneath the first "?".
japhy% perl -MO=Deparse,-p my $word = $part eq 'n' ? $word = new Noun(@blah) : $part eq 'v' ? $word = new Verb(@blah) : $word = new Adjective(@blah);
Check that out and you'll see that $word ends up getting assigned as an Adjective object no matter what, because of the precedence of ?: compared with that of =.

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a job (NYC-area)
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;