in reply to Re: Multiple Packages in a Module?
in thread Multiple Packages in a Module?

haukex: ...the equivalent of use would be BEGIN { require test_v1; Foo->import(); Foo::Bar->import(); }.
Actually, no. The equivalent would be BEGIN { require test_v1; test_v1->import; }.

Replies are listed 'Best First'.
Re^3: Multiple Packages in a Module?
by haukex (Archbishop) on Jun 25, 2018 at 20:45 UTC
    Actually, no. The equivalent would be BEGIN { require test_v1; test_v1->import; }.

    No, because I wrote "in the case you describe", which is that there is one file test_v1.pm with two packages, Foo and Foo::Bar (no mention of a package test_v1). The code I showed is the equivalent of splitting that one file into two (Foo.pm and Foo/Bar.pm) and useing them individually.

      Agreed. I seem to have had difficulties with identifying "in the case you describe" as splitting one file into two.

        My first reply was a bit terse, I've added an update to hopefully clarify what I meant.