Skip Menu |

This queue is for tickets about the Tree-Simple CPAN distribution.

Report information
The Basics
Id: 84797
Status: rejected
Worked: 5 min
Priority: 0/
Queue: Tree-Simple

People
Owner: Nobody in particular
Requestors: MRDVT [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.18
Fixed in: 1.18



Subject: Tree::Simple->setUID returns $uid instead of $self like "normal" Perl setter accessors
This makes it hard to use this object in an orsacache loop. recommend sub setUID { my ($self, $uid) = @_; ($uid) || die "Insufficient Arguments : Custom Unique ID's must be a true value"; $self->{_uid} = $uid; return $self; #add this one line! } It might also be possible with a different constructor where the uid could be specified on construction. my $child_tree = $cache{$child_id} ||= Tree::Simple->leaf(uid=>$child_id, node=>$child_id); But this does NOT work my $child_tree = $cache{$child_id} ||= Tree::Simple->new($child_id)->setUID($child_id);
Sorry, but I (Ron) am rejecting this because there could be any amount of code depending on the return value of setUID being the id. Changing that return value would break such code. A work-around is to subclass and change whatever you want.