Comma quibbling: Difference between revisions

m
→‎{{header|Perl}}: future-proof for 5.36, explicit :prototype
(updated solution for Arturo)
m (→‎{{header|Perl}}: future-proof for 5.36, explicit :prototype)
Line 3,171:
=={{header|Perl}}==
{{trans|Raku}}
<syntaxhighlight lang="perl">sub comma_quibbling :prototype(@) {
return "{$_}" for
@_ < 2 ? "@_" :
Line 3,188:
 
<syntaxhighlight lang="perl">use 5.01;
sub comma_quibbling {
my $last = pop // '';
return '{'. (@_ ? (join ', ', @_).' and '.$last : $last).'}';
2,392

edits