in reply to Re: Wrapping requires in a package...
in thread Wrapping requires in a package...

Sorry, I forgot to mention that in my testing, do had the same inconsistant behavior as require that I report elsewhere in this thread.

        - tye (but my friends call me "Tye")
  • Comment on (tye)Re2: Wrapping requires in a package...

Replies are listed 'Best First'.
Re: (tye)Re2: Wrapping requires in a package...
by perrin (Chancellor) on Sep 08, 2001 at 09:01 UTC
    I don't think it matters as long as the code he's do()ing doesn't have any use of __PACKAGE__ constructs or declare "package main" anywhere. The subs will be defined in the right package.

      But what if two different files do use vars qw( $level ); Will both be trying to share $main::level or will the variables be defined in the requested package like the subroutines (easy enough to check but I wasn't that interested in the problem). Are there more subtle problems? Someone reported to me that they were looking into all of this.

      But the real solution is to turn these files into real packages, which is what I hear is now being done. (:

              - tye (but my friends call me "Tye")