in reply to Re: Good practice: Variable declaration
in thread Good practice: Variable declaration
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 =.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);
_____________________________________________________
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:??;
|
|---|