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

Re: execute a string as a function

by LanX (Chancellor)
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 perusing the Monastery: (13)
As of 2015-11-30 15:59 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (777 votes), past polls