in reply to Re: Splitting program into modules
in thread Splitting program into modules

Can you tell us how your code improves over do and require?

Also, please note the limitations of your code, like that it doesn't handle files larger than a megabyte.

Replies are listed 'Best First'.
Re^3: Splitting program into modules
by harangzsolt33 (Deacon) on Nov 12, 2018 at 03:06 UTC
    Oh, yes, there seems to be no difference between include() and require. I haven't thought of that! :/
      > no difference between include() and require

      Actually you reimplemented do

      require is basically a do that searches through @INC and accepts module::names.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

        Actually you reimplemented do

        ..., poorly: do has no 1 MB limit, do keeps track of the current filename for error messages, lexicals from the enclosing scope are not visible to code executed by do, and in case of relative paths other than './' and '../', do searches @INC and updates %INC.

        Alexander

        --
        Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)