Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
下面的代码是如何在 Perl 中实现的?
sub add_item : Local { my ( $self, $c ) = @_; my $item_id = $c->req->param("item"); push @{ $c->session->{items} }, $item_id; }
我对add_item : Local部分感兴趣,因为我认为这些不是 Perl 关键字。
它们是属性。请参阅属性文档,以及通过 my() 的私有变量和perlsub中的子例程属性。