# in some parent formatting, template processing module use Template; # not actually using it in the code here use Template::Stash; $Template::Stash::LIST_OPS->{ serial } = sub { my @list = @{ +shift || [] }; join(', ', @list[0..$#list-1]) . (@list>2 ? ',':'' ) . (@list>1 ? (' and ' . $list[-1]) : $list[-1]); };