Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^2: "Dynamic" dispatch tables

by elTriberium (Friar)
on Apr 29, 2011 at 20:26 UTC ( #902069=note: print w/replies, xml ) Need Help??

in reply to Re: "Dynamic" dispatch tables
in thread "Dynamic" dispatch tables

You're right, I'm not sure yet if I really need a hash. I'll have to figure out some of the details.

I also already started using the "not exists" part, but running into a problem with that: I want to move the setup of the dispatch table / array into a module, but in the module the "exists &{"tcid_$_"} always fails as the sub is not defined in this module. Is there a good workaround for this?

Replies are listed 'Best First'.
Re^3: "Dynamic" dispatch tables
by Tanktalus (Canon) on Apr 29, 2011 at 20:55 UTC
    Yes. What package will they be in? If they'll be in the Foo package, then just use exists &{"Foo::tcid_$_"} instead. :-)
      They won't be in any package, but in the .pl script. I got it to work by using "main::", thanks for the hint.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2023-05-30 18:13 GMT
Find Nodes?
    Voting Booth?

    No recent polls found