Re: Getting a subroutine reference from an object instance

2010-04-12 Thread Eric Veith1
Peter Scott wrote on 04/10/2010 03:33:46 PM: > You'd probably benefit from taking this to a Moose list. Good idea. Thanks for all the help, especially to Shlomi, who pointed out the $instance->can('foo') solution. Eric -- Eric MSP Veith Hechtsheimer Str. 2 DE-55131 Ma

Re: Getting a subroutine reference from an object instance

2010-04-10 Thread Peter Scott
On Fri, 09 Apr 2010 16:34:27 +0200, Eric Veith1 wrote: > Peter, >> I suspect you would have an easier time if you wrote what sounds like a >> largish project using Moose and composed in a forkable role. If you > must >> use method attributes there is MooseX::MethodAttributes but (and I am >> gett

Re: Getting a subroutine reference from an object instance

2010-04-09 Thread Eric Veith1
Peter, Peter Scott wrote on 04/09/2010 03:45:54 AM: > Yikes, I do not like that design. Forking should be defined in its own > independent location, not as some part of a global funnel that all method > calls pass through. AFAIK Method attributes are per-package. I am already using Moose to

Re: Getting a subroutine reference from an object instance

2010-04-08 Thread Peter Scott
On Thu, 08 Apr 2010 21:37:10 +0300, Shlomi Fish wrote: > On Thursday 08 Apr 2010 17:19:39 Peter Scott wrote: >> On Wed, 07 Apr 2010 18:23:25 +0200, Eric Veith1 wrote: >> > this is probably going to be quick one. I know how to get an >> > subroutine reference under "normal" circumstances, but I don'

Re: Getting a subroutine reference from an object instance

2010-04-08 Thread Peter Scott
On Thu, 08 Apr 2010 21:08:54 +0200, Eric Veith1 wrote: > Shlomi Fish wrote on 04/08/2010 08:37:10 PM: >> > Uh, what are you really trying to do? There are helper modules that > make >> > using attributes much easier. >> >> Yes, I'm wondering about it too. > > I'm trying to use method attributes

Re: Getting a subroutine reference from an object instance

2010-04-08 Thread Eric Veith1
Shlomi Fish wrote on 04/08/2010 08:37:10 PM: > > Uh, what are you really trying to do? There are helper modules that make > > using attributes much easier. > > Yes, I'm wondering about it too. I'm trying to use method attributes to get a certain behaviour with some syntactic sugar. Like, for

Re: Getting a subroutine reference from an object instance

2010-04-08 Thread Shlomi Fish
On Thursday 08 Apr 2010 17:19:39 Peter Scott wrote: > On Wed, 07 Apr 2010 18:23:25 +0200, Eric Veith1 wrote: > > this is probably going to be quick one. I know how to get an subroutine > > reference under "normal" circumstances, but I don't know how to get one > > from an object instance. Like: > >

Re: Getting a subroutine reference from an object instance

2010-04-08 Thread Peter Scott
On Wed, 07 Apr 2010 18:23:25 +0200, Eric Veith1 wrote: > this is probably going to be quick one. I know how to get an subroutine > reference under "normal" circumstances, but I don't know how to get one > from an object instance. Like: > > ---%<--- > my $foo = My::Foo->new("bleh"); > > # Calling

Re: Getting a subroutine reference from an object instance

2010-04-07 Thread Steve Bertrand
On 2010.04.07 16:39, Shlomi Fish wrote: > On Wednesday 07 Apr 2010 19:23:25 Eric Veith1 wrote: >> Hello Perlers, >> >> this is probably going to be quick one. I know how to get an subroutine >> reference under "normal" circumstances, but I don't know how to get one >> from an object instance. Like:

Re: Getting a subroutine reference from an object instance

2010-04-07 Thread Shlomi Fish
On Wednesday 07 Apr 2010 19:23:25 Eric Veith1 wrote: > Hello Perlers, > > this is probably going to be quick one. I know how to get an subroutine > reference under "normal" circumstances, but I don't know how to get one > from an object instance. Like: > > ---%<--- > my $foo = My::Foo->new("bleh"

Getting a subroutine reference from an object instance

2010-04-07 Thread Eric Veith1
Hello Perlers, this is probably going to be quick one. I know how to get an subroutine reference under "normal" circumstances, but I don't know how to get one from an object instance. Like: ---%<--- my $foo = My::Foo->new("bleh"); # Calling the sub: $foo->quux; # How would I get the reference