Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

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


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?)
Re: Re: Re: constant and eval (are they enemies?)
by Anonymous Monk on May 24, 2002 at 00: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
Node Status?
node history
Node Type: note [id://168570]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2015-07-06 23:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (85 votes), past polls