前端之家收集整理的这篇文章主要介绍了
Perl join 函数,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
[oracle@jhoa 14]$ cat a3.pl
@array=qw/a b c d e f g/;
$var = join("9",@array);
print "\$var is $var\n";
[oracle@jhoa 14]$ perl a3.pl
$var is a9b9c9d9e9f9g
join EXPR,LIST
Joins the separate strings of LIST into a single string with fields
separated by the value of EXPR,and returns that new string. Exam-
ple:
$rec = join(':',$login,$passwd,$uid,$gid,$gcos,$home,$shell);
Beware that unlike "split","join" doesn't take a pattern as its
first argument. Compare "split".
join 表达式,列表
拼接函数