package Attr; sub new :method { return bless {}, shift } sub set_blah :method { my ( $self, $blah ) = @_; $self->{blah} = $blah; return $self; } sub get_blah :method { my $self = shift; return $self->{blah}; } 1; package main; my $obj = Attr->new; $obj->set_blah('I just set something!'); print $obj->get_blah;
In reply to Re: how to use attributes?
by varian
in thread how to use attributes?
by rvosa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |