in reply to how to use attributes?
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to use attributes?
by rvosa (Curate) on Mar 22, 2007 at 19:01 UTC |