Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: execute a string as a function

by LanX (Canon)
on Oct 06, 2013 at 14:03 UTC ( #1057149=note: print w/ replies, xml ) Need Help??


in reply to execute a string as a function

strange, nobody mentioned using OOP yet

DB<147> ;{ package tst; sub a { "A" }; sub b {"B"} } DB<148> map { tst->$_ } 'a','b','a' => ("A", "B", "A")

classes and objects are essentially dispatch tables and methods are strings!

( just be careful about $_[0] :)

Cheers Rolf

( addicted to the Perl Programming Language)


Comment on Re: execute a string as a function
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2014-08-22 00:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (144 votes), past polls