note
Preceptor
<P>#include disclaimer on why one-liners are generally undesirable.</P>
<P>Consider a ternary operator. Specifically:</P>
<CODE>
condition ? result_if_true : result_if_false
</CODE>
<P>You could then make this function:</P>
<CODE>
wantarray ? first {$_} map { lc } @_ : map { lc } @_ ;
</CODE>
<P>Note also - return is (almost) redundant if it's the last line of the code - by default Perl returns from a sub 'the result of the last operation'. This too though, isn't always a good thing, because readable code almost always trumps really short code. </P>
1043526
1043526