📄 程嶏清单9-16.txt
字号:
@lists = (
[ 'just one thing' ],
[ qw(Mutt Jeff) ],
[ qw(Peter Paul Mary) ],
[ 'To our parents', 'Mother Theresa', 'God' ],
[ 'pastrami', 'ham and cheese', 'peanut butter and jelly', 'tuna' ],
[ 'recycle tired, old phrases', 'ponder big, happy thoughts' ],
[ 'recycle tired, old phrases', 'ponder big, happy thoughts', 'sleep and dream peacefully' ],
);
sub commify_series {
my $sepchar = grep(/,/ => @_) ? ";" : ",";
(@_ == 0) ? '' :
(@_ == 1) ? $_[0] :
(@_ == 2) ? join(" and ", @_) :
join("$sepchar ", @_[0 .. ($#_-1)], "and $_[-1]");
}
foreach $aref (@lists) {
print "The list is: " . commify_series(@$aref) . ".\n";
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -