Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Dispatching Method Objects

by gbarr (Monk)
on Oct 03, 2001 at 21:25 UTC ( [id://116518]=note: print w/replies, xml ) Need Help??


in reply to Dispatching Method Objects

You are right that the error is the $self-> in the sub call. Lets see what it's doing

&{ # call the result of the block as a sub $self->{ # lookup in hash $self the result of $dispatch{$command} # lookup $command in %dispatch } }(); # call the sub with no arguments

I am guessing you want to call the sub, passing $self, which should be

&{$dispatch{$command}}($self);

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-19 22:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found