views:

280

answers:

1

How is the following code implemented in Perl?


sub add_item : Local {
     my ( $self, $c ) = @_;

     my $item_id = $c->req->param("item");

     push @{ $c->session->{items} }, $item_id;

  }

I am interested in the add_item : Local part, cause I don't think those are Perl keywords.

+9  A: 

They are attributes. See the attribute documentation, but also Private Variable via my() and Subroutine Attributes in perlsub.

Leon Timmermans
Interesting! I thought those were implemented with the help of a source filter.
Geo
You know, I hear you can "read the source" to determine this.
jrockway