in reply to Spanning Modules Across Multiple Files

It's not "wrong", but you could use the advantages of the "Perl5-Module-Stuff", so instead of having "Zephir-General.pl" als 'library', you should have a "Zephir/General.pm" with the package Zephir::General.

Zephir.pm (package Zephir) could then be an interface to the other Modules (e.g. via AUTOLOAD) and make functions available on-demand and export stuff on demand.

Next step could be OO, Zephir.pm providing factories for the Zephir::* Subclasses, then you might make the modules even more flexible and usefull for others and then upload it to the CPAN and ... yes.
  • Comment on Re: Spanning Modules Across Multiple Files

Replies are listed 'Best First'.
Re: Re: Spanning Modules Across Multiple Files
by caedes (Pilgrim) on Jul 05, 2002 at 12:52 UTC
    Good ideas. I actually started out with Zephir::General, etcetera but later digresed to the single package when I noticed that all my scripts used every submodule. And yes you are right about the eventual OO implementation of the module, but I probably won't be doing it quite yet.

    -caedes

      You can put some code into Zephir/General.pm, load it with use Zephir::General but still have it in Zephir package as long as Zephir/General.pm starts with package Zephir. Module SomeName isn't really required to contain package SomeName. It is common convention but it is not strict rule you cannot break.

      --
      Ilya Martynov (http://martynov.org/)

      all my scripts used every submodule

      That's why I think you should let Zephir.pm organize loading and exporting of libraries. It could export an AUTOLOAD routine and fetch other stuff really in-time. Your scripts will use this interface without noticing what's going on behind the scenes, they just call subroutines.