spatterson has asked for the wisdom of the Perl Monks concerning the following question:
I've written a module which simplifies access to a recon database for an RPG. The info in this database is a list of city blocks with some additional info for each. This module is also intended to be used by any number of perl scripts.
So, what I have for it to be generic is 1 object constructor and a few subroutines which run as methods of that object, so that each city block is represented by an object. Plus 1 other sub that is needed but it does not make sense to call with a block object (it works out what map coords you want to look at).
Is there a better/more elegant way of doing this? So far I've only really used objects as complex data stores (like a c struct) or if you'd normally be passing several of them around.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mixing OO & non OO code in a module
by hv (Prior) on Jun 06, 2006 at 12:44 UTC | |
by jdhedden (Deacon) on Jun 06, 2006 at 16:25 UTC | |
|
Re: Mixing OO & non OO code in a module
by MonkE (Hermit) on Jun 06, 2006 at 12:52 UTC |