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

Error in perl matching

发布时间:2020-12-15 23:49:13 所属栏目:大数据 来源:网络整理
导读:We got this error by running: ? my $str = "reb,cheng"; $str = ~ s/,//; print $str,"n"; ? seems everything is okay,but why? Here is the error message: C:Rebeccascriptperlperl status_v0.2_clear.pl Use of uninitialized value $_ in substit

We got this error by running:

?

my $str = "reb,cheng";

$str = ~ s/,//;

print $str,"n";

?

seems everything is okay,but why?

Here is the error message:

C:Rebeccascriptperl>perl status_v0.2_clear.pl

Use of uninitialized value $_ in substitution (s///) at status_v0.2_clear.pl line 88,<DATA> line 751.

18446744073709551615

?

Notice there is a space between “=” and “~”,the correct way should be NO SPACE between them:

my $str = "reb,"n";;

?

then we got:

C:Rebeccascriptperl>perl status_v0.2_clear.pl

rebcheng

?

It is executed successfully after removing the space!!

(编辑:李大同)

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

    推荐文章
      热点阅读