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 the sub:
> $foo->quux;
> 
> # How would I get the reference to the sub just called, so that I could
> do:
> $quuxref->();

$quuxref = $foo->can( 'quux' );

> I need this for the "attributes" pragma. :-)

Uh, what are you really trying to do?  There are helper modules that make 
using attributes much easier.


-- 
Peter Scott
http://www.perlmedic.com/     http://www.perldebugged.com/
http://www.informit.com/store/product.aspx?isbn=0137001274
http://www.oreillyschool.com/courses/perl1/

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to