in reply to require & $main::variables

How do you declare $project within your main package? My initial thought is that you're declaring it using my, in which case it's a lexical variable, not a package variable and won't be visible from outside the main file.

If that's not right, perhaps you can post a cut-down versnio of the code which exhibits this behaviour.

--
<http://www.dave.org.uk>

"Perl makes the fun jobs fun
and the boring jobs bearable" - me

Replies are listed 'Best First'.
Re: Re: require & $main::variables
by physi (Friar) on Apr 03, 2001 at 12:53 UTC
    Yeep, that was it. Now I use our in main and it works with require. Thanks.
    But in another program it works with use and my in the main program.

    Maybe require is a little bit different from use in that case.

    ----------------------------------- --the good, the bad and the physi-- -----------------------------------

      Read up on require and use ... they are indeed different (use requires the file and then imports all the variables the file exports.)
      perlfunc:require
      perlfunc:use

      Philosophy can be made out of anything. Or less -- Jerry A. Fodor