in reply to 1 Object 2 Files

It sounds to me like this is a fine case for require. Since it sounds like you might want to dynamicaly load portions at run time (just a guess) then require fits the bill. Sometimes use fits, sometimes require. You can use package statments in either so the real difference comes down to if you want it included at run time, or compile time, and if you have anything that needs imported out of the package. Since it doesn't realy sound like you have anything module'ish about those files it sounds like a job for require. Of course I might be way off base, but then maybe the person who said only use "use" was confused.


___________
Eric Hodges

Replies are listed 'Best First'.
Re^2: 1 Object 2 Files
by simonm (Vicar) on Jan 12, 2005 at 20:21 UTC
    Agreed, this sounds like a good place for require.

    This would also let the files share common base names with different extensions, as the OP had desired.

    # In lib/MyCode/Form1.pm package MyCode::Form1; require "lib/MyCode/Form1.tkfrm"; sub handle_button { ... } 1;
    # In lib/MyCode/Form1.tkfrm # package declaration is optional sub layout_form { ... } 1;