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?