Re: deep recursion on anonymous subroutine

[prev] [thread] [next] [Date index for 2005/04/07]

From: Perrin Harkins
Subject: Re: deep recursion on anonymous subroutine
Date: 16:15 on 07 Apr 2005
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

deep recursion on anonymous subroutine
Simon Wistow 15:58 on 07 Apr 2005

Re: deep recursion on anonymous subroutine
Perrin Harkins 16:15 on 07 Apr 2005

Re: deep recursion on anonymous subroutine
Tony Bowden 16:52 on 07 Apr 2005

Generated at 06:54 on 17 May 2005 by mariachi v0.52