加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

为什么我不能在Perl中设置$LIST_SEPARATOR?

发布时间:2020-12-16 06:12:11 所属栏目:大数据 来源:网络整理
导读:我想在perl中设置LIST_SEPARATOR,但我得到的就是这个警告: Name "main::LIST_SEPARATOR" used only once: possible typo at ldapflip.pl line 7. 这是我的计划: #!/usr/bin/perl -w@vals;push @vals,"a";push @vals,"b";$LIST_SEPARATOR='|';print "@vals
我想在perl中设置LIST_SEPARATOR,但我得到的就是这个警告:

Name "main::LIST_SEPARATOR" used only once: possible typo at ldapflip.pl line 7.

这是我的计划:

#!/usr/bin/perl -w

@vals;
push @vals,"a";
push @vals,"b";

$LIST_SEPARATOR='|';

print "@valsn";

我确信我错过了一些明显的东西,但我没有看到它.

谢谢

解决方法

perlvar是你的朋友:

? $LIST_SEPARATOR
? $"

This is like $, except that it applies to array and slice values interpolated into a double-quoted string (or similar interpreted string). Default is a space. (Mnemonic: obvious,I think.)

$LIST_SEPARATOR只有在您使用英语时才可用;如果你不想使用英语;在你的所有程序中,使用$“而不是.相同的变量,只是更简洁的名称.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读