My understanding of English grammar is that a comma should not precede an 'and' statement when describing a list - If I am mistaken on this understanding, please feel free to enlighten me. Be that the case however, I would rewrite your function as follows:
sub serial { join( ', ', @_[ 0..$#_-1 ] ) . ( @_ > 1 ? ' and ' : '' ) . $_[-1] }
perl -le 'print+unpack("N",pack("B32","00000000000000000000001001001011"))'
In reply to Re: serial comma function
by rob_au
in thread serial comma function
by Your Mother
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |