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

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 having an uproarious good time at the Monastery: (5)
As of 2016-02-14 04:16 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (457 votes), past polls