[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 表达式,列表
拼接函数
Perl join 函数
最新推荐文章于 2024-08-07 14:22:19 发布
本文介绍了Perl中的join函数,通过示例展示了如何使用该函数将列表中的字符串连接成一个新字符串,并解释了其基本语法和注意事项。
摘要由CSDN通过智能技术生成