Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: How to include a large number of constants?

by BrowserUk (Patriarch)
on Apr 27, 2005 at 17:44 UTC ( [id://452050]=note: print w/replies, xml ) Need Help??


in reply to How to include a large number of constants?

do file is probably the simplest way. Otherwise, you have to arrange for them to be exported from the modules namespace into the callers.

do 'g1.inc';

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco.
Rule 1 has a caveat! -- Who broke the cabal?

Replies are listed 'Best First'.
Re^2: How to include a large number of constants?
by noslenj123 (Scribe) on Apr 27, 2005 at 20:32 UTC
    I tried using "do 'g1.inc';" but I get the same results as require with the bareword warning...

      For the constant subs to be recognised as such when the code that calls them is compiled, you'll need to put the do in a BEGIN{} block.

      BEGIN{ do 'gi.inc'; }

      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco.
      Rule 1 has a caveat! -- Who broke the cabal?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-26 04:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found