$$

来源:互联网 发布:隐形眼镜牌子 知乎 编辑:程序博客网 时间:2024/06/10 07:16

The use of $$ instead of $ at the beginning of two of these variables indicates that they are references to scalar variables. Recall that they were passed in as arguments to the subroutine, where they were preceded by a backslash, like so: parse_blast(/$beginning_annotation, /$ending_annotation, /%alignments, $filename);You've seen references to variables before, starting in Chapter 6. Let's review them briefly. Within the parse_blast subroutine, those variables with only one $ are references to the scalar variables. They need an additional $ to represent actual scalar variables. This is how references work; they need an additional special character to indicate what kinds of variables they are references to. So a reference to a scalar variable needs to start with $$, a reference to an array variable needs to start with @$, and a reference to a hash variable needs to start with %$.

原创粉丝点击