in reply to Re^2: How Much Is Too Much (on one line of code)?
in thread How Much Is Too Much (on one line of code)?
Compare that to:my $some = get_word(); my $when = $some eq 'body' ? 'has to fight' : $some eq 'thing' ? 'has to give' : $some eq 'day' ? 'they will know the truth' : $some eq 'where' ? 'in a avery near place to their mind' : $some eq 'time' ? 'can only tell' : 'yes, there is always a space for default';
Update: Putting it in the given-when construct would be nicer for me. But, until then....my $some = get_word(); my $when; if ($some eq 'body'); { $when = 'has to fight'; } elsif ($some eq 'thing') { $when = 'has to give'; } elsif ($some eq 'day') { $when = 'they will know the truth'; } elsif ($some eq 'where') { $when = 'in a avery near place to their mind'; } elsif ($some eq 'time') { $when = 'can only tell'; } else { $when = 'yes, there is always a space for default'; }
Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: How Much Is Too Much (on one line of code)?
by johngg (Canon) on Jun 18, 2007 at 15:36 UTC | |
by naikonta (Curate) on Jun 18, 2007 at 15:49 UTC | |
by johngg (Canon) on Jun 18, 2007 at 15:58 UTC |