Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: passing arguments in a dispatch table

by samtregar (Abbot)
on Apr 28, 2002 at 01:56 UTC ( [id://162586]=note: print w/replies, xml ) Need Help??


in reply to passing arguments in a dispatch table

Looks OK to me, although I don't really know what you're testing. %$dispatch is indeed a hash of CODE-refs, which you can use a "dispatch table." But you knew that. What was the question again?

-sam

  • Comment on Re: passing arguments in a dispatch table

Replies are listed 'Best First'.
Re: Re: passing arguments in a dispatch table
by CharlesClarkson (Curate) on Apr 28, 2002 at 06:36 UTC

    Gee. You'd think you weren't looking over my shoulder the whole day and only had this one message to figure out what was going on.    :)

    If we change the dispatch table:
    my $dispatch = { add => \&add_entry( $fruit ), };
    We get this result:
    Sun Apr 28 01:23:38 2002 <--   in sub 
    Sun Apr 28 01:23:39 2002
    Not a CODE reference at aaaa.pl line 17.
    

    The test in the original example allowed me to see that the times were in the correct order. If perl was running the sub immediately, the times would be out of order. I was unsure if this test made sense. Hence the question.


    HTH,
    Charles K. Clarkson
    Clarkson Energy Homes, Inc.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-25 21:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found