Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Referencing Subroutines through a package

by mzedeler (Pilgrim)
on Aug 16, 2009 at 08:58 UTC ( [id://788993]=note: print w/replies, xml ) Need Help??


in reply to Referencing Subroutines through a package

If you want $ContentHandler->{'/'}->() to invoke the Event method on $self->{object}, you can use an anonymous subroutine like so:

ContentHandler => { '/' => sub {return $self->{object}->Event(@_)} }

By the way, calling an attribute object is probably a really bad idea.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://788993]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2024-04-24 08:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found