Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: on the fly methods

by fenLisesi (Priest)
on Feb 27, 2007 at 16:39 UTC ( [id://602330]=note: print w/replies, xml ) Need Help??


in reply to on the fly methods

You could do:
$this->{_coderef} = sub{ return "Don\'t think so"; }; ## ... and later: printf "%s\n", $this->{_coderef}->();
Do you have to create your methods on the fly? There could be better ways. Cheers.

Update: Changed "_codestring" to "_coderef"

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2024-04-25 15:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found