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

Perl中的 – > arrow做什么?

发布时间:2020-12-15 21:20:19 所属栏目:大数据 来源:网络整理
导读:我一直看到 – 在代码中,我不太清楚这是什么意思。例如: @top_links = @{$m-links}; 这条线做什么?此外,我可以在哪里阅读? 解决方法 参见 The Arrow Operator perlop: “ - ” is an infix dereference operator,just as it is in C and C++. If the r
我一直看到 – >在代码中,我不太清楚这是什么意思。例如:
@top_links = @{$m->links};

这条线做什么?此外,我可以在哪里阅读?

解决方法

参见 The Arrow Operator perlop:

->” is an infix dereference operator,just as it is in C and C++. If the right side is either a [...],{...},or a (...) subscript,then the left side must be either a hard or symbolic reference to an array,a hash,or a subroutine respectively. (Or technically speaking,a location capable of holding a hard reference,if it’s an array or hash reference being used for assignment.) See 07001 and 07002.

Otherwise,the right side is a method name or a simple scalar variable containing either the method name or a subroutine reference,and the left side must be either an object (a blessed reference) or a class name (that is,a package name). See 07003.

(编辑:李大同)

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

    推荐文章
      热点阅读