Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: (Ovid) Re: Coderef from scalar.

by vaevictus (Pilgrim)
on Dec 29, 2001 at 05:10 UTC ( #135037=note: print w/replies, xml ) Need Help??


in reply to (Ovid) Re: Coderef from scalar.
in thread Coderef from scalar.

Defined as the problem, I *must* use a scalar full of code.

Replies are listed 'Best First'.
(Ovid) Re(3): Coderef from scalar.
by Ovid (Cardinal) on Dec 29, 2001 at 05:16 UTC

    This is often true, so I can understand why an eval might be necessary. What, exactly, is the source of the scalar? Is this being built at runtime? If so, eval might be the answer. If it's a bunch of static code snippets that can be determined at compile time, a hash of coderefs is faster and safer.

    Cheers,
    Ovid

    Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

      yes ... it's part of a programmable IRC bot, using Net::IRC.
      the "special function" is Net::IRC::Connection->add_handler();
      so, yes, it's getting the code at runtime...

      I'm wanting to implement a ircbot with features similar to Everything(tm).

        If the code is coming from untrusted sources, definitely look into using Safe.pm and restrict the hell out of the permitted opcodes.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2022-01-24 17:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (64 votes). Check out past polls.

    Notices?