>>282 Perl5

sub f {
 my $a = shift;
 @_ ? (@_ > 1 ? "$a, " : "$a and ").f(@_) : $a
}

use feature say;

say f(qw[red green black white]);
say f(qw[apple banana]);
say f(qw[one]);


実行結果
~ $ perl 13_279_and.pl
red, green, black and white
apple and banana
one