Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: General pattern for interactive text-mode script?

by starbolin (Hermit)
on Jul 03, 2008 at 23:13 UTC ( #695492=note: print w/ replies, xml ) Need Help??


in reply to Re^2: General pattern for interactive text-mode script?
in thread General pattern for interactive text-mode script?

An ethereal Anonymous Monk writes:

"...because I'm still not sure what it buys me over just calling the functions directly."
Because you store references to the functions in the hash and can call the function indirectly by de-referencing the hash value instead of hard coding the subroutine name into a fixed control structure. Much easier, and safer, store a reference than to indirect reference via a string. It is very important for you future programing success that you learn to write and understand dispatch tables. You will encounter them in many programs and use them often in your own code.



s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}


Comment on Re^3: General pattern for interactive text-mode script?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (10)
As of 2014-12-22 14:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (119 votes), past polls