DickieC has asked for the wisdom of the Perl Monks concerning the following question:
I have a few rather large data structures that I want to use in a package (currently stuffed in a single file and required as needed).
Now I've decided that I really should try to get the hang of this OO stuff, and I'd like to know whether I can (or should!) use a require in the package I'm making (like in the scripts I've been using) rather than adding a few hundred lines to the package file itself, i mean like
package Blocker; use strict; use Switch; require "data_defs.pl"; ...
Would this create any problems? Would each object have it's own copy of the data, or would there still only be one like a require in a normal script? - Like I say, there is alot of data.
I would include some more code here, but you'd probably laugh at me (alot...!)
Thanks for any advice you can give!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Require in modules...?
by ikegami (Patriarch) on May 10, 2009 at 00:55 UTC | |
|
Re: Require in modules...?
by Joost (Canon) on May 10, 2009 at 02:06 UTC | |
by ikegami (Patriarch) on May 10, 2009 at 03:06 UTC | |
|
Re: Require in modules...?
by pemungkah (Priest) on May 11, 2009 at 20:38 UTC | |
by DickieC (Initiate) on May 16, 2009 at 22:39 UTC |