AllenG has asked for the wisdom of the Perl Monks concerning the following question:
I want to create a multiform Perl Tk application where each form is defined by two physical files. One file controls the appearnce of the form, and the other controls the functionality.
I was thinking of having each file with the same name, but different extensions, then calling them with "require". In each file would be the "package" key word identifying the name of the form as an object.
Recently I was told not to use "require" and only use "use", but from what I can tell "use" requires a ".pm" extension and the name of the file is the name of the package. So how do I use "use" on two files that I want the same namespace?
UPDATE: Thanx for everyones help. As a matter of fact, many of the forms need only be loaded when they are required, so I may use a mix of the approaches suggested.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: 1 Object 2 Files
by eric256 (Parson) on Jan 11, 2005 at 21:56 UTC | |
by simonm (Vicar) on Jan 12, 2005 at 20:21 UTC | |
|
Re: 1 Object 2 Files
by dragonchild (Archbishop) on Jan 11, 2005 at 20:50 UTC | |
by Tanktalus (Canon) on Jan 11, 2005 at 20:52 UTC | |
by dragonchild (Archbishop) on Jan 11, 2005 at 20:54 UTC | |
by Tanktalus (Canon) on Jan 11, 2005 at 20:57 UTC | |
by dragonchild (Archbishop) on Jan 11, 2005 at 21:05 UTC |