That's fine. You could be spiffy and write it like:
my %class = qw( n Noun v Verb );
my $word = ($class{$part} || "Adjective")->new(...);
Spiffier.
my $word = ({ qw/n Noun v Verb/ }->{$part} || 'Adjective')->new(...);
- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.
In reply to Re: Re: Good practice: Variable declaration
by Juerd
in thread Good practice: Variable declaration
by Basilides
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |