Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
more useful options
 
PerlMonks  

Re: Re: constant and eval (are they enemies?)

by tune (Curate)
on May 22, 2002 at 15:59 UTC ( [id://168570]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: constant and eval (are they enemies?)
in thread constant and eval (are they enemies?)

Thanks. I cannot use the import() thing, because I parse the constant name and the value from a file. That's why I have to use 'eval'...

--
tune

  • Comment on Re: Re: constant and eval (are they enemies?)

Replies are listed 'Best First'.
Re: Re: Re: constant and eval (are they enemies?)
by Anonymous Monk on May 23, 2002 at 20:20 UTC
    Why can't you do
    require constant; constant::->import($name => $value);
    ?

    -Anomo
      That's happening at runtime, not compile time. While you could put a BEGIN block around it, the code I posted elsewhere in this thread copies the method of the module, without even having to invoke the overhead of the module.

      -- Randal L. Schwartz, Perl hacker

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://168570]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.