Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2015-05-26 01:02 GMT
Find Nodes?
    Voting Booth?

    In my home, the TV remote control is ...

    Results (491 votes), past polls