Re: deep recursion on anonymous subroutine
[prev]
[thread]
[next]
[Date index for 2005/04/07]
On Thu, 2005-04-07 at 16:58 +0100, Simon Wistow wrote:
> I have 3 classes Version Maintainer and User
>
> Uploader->has_a( version => "Version" );
> Uploader->has_a( uploader => "User" );
>
>
> which means I can do
>
> $version->uploader->uploader->name;
>
> But, obviously I'd prefer to be doing $version->uploader->name;
>
> However, doing
>
> Version->might_have(uploader => "Uploader" => qw/uploader/);
When I have this situation, I just use set_sql and do the join.
However, this might also work, sacrificing efficiency:
Version->has_many(uploader => [ Uploader => qw/uploader/ ]);
my ($uploader) = $version->uploader();
- Perrin
|
|
Re: deep recursion on anonymous subroutine
Perrin Harkins 16:15 on 07 Apr 2005
|