in reply to What does this mean?
It's a common setter/getter idiom however with an unfortunate chosen method name setID.
'get' attribute: no argument given, so $id is undefined, current value of $self->{_id} is returned
'set' attribute (and 'get' new value at the same time)my $id = $obj->setID(); # return current _id
my $new_id = $obj->setID( 42 ); # updates and returns new _id 42 # or just: $obj->setID( 42 );
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: What does this mean?
by tobyink (Canon) on Aug 20, 2012 at 22:24 UTC |
In Section
Seekers of Perl Wisdom