Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This file also contains subroutines that are method calls in these packages. For example:
One solution is to make this file a base class. But that only works if I am only making method calls. I am not. I am also calling functions like this:# the new method is in the file. my $p = $namespace->new; # do_this is also a method in this other file my $p->do_this()
So if I don't make this file a base class, I thought of turning it into a module that exports its subroutines. But I am running into trouble. I think the trouble stems from a number reasons:# function_call is a subroutine in that same file my $text = function_call();
1. This file contains methods and functions that work together. For example, the do_this() method may change a scalar value in the function_call() subroutine.
2. This file is shared among separate files that are modules in themselves. So module A uses this file's new subroutine to create an object. And module B also uses this file for the same purpose. And module A then uses module B.
I am at my wit's end and don't know what's the best thing to do. Please help. :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Arcitectural considerations with modules
by kwaping (Priest) on Dec 30, 2005 at 02:44 UTC | |
by Anonymous Monk on Dec 30, 2005 at 09:08 UTC | |
|
Re: Arcitectural considerations with modules
by Aristotle (Chancellor) on Dec 30, 2005 at 06:54 UTC | |
|
Re: Arcitectural considerations with modules
by sgifford (Prior) on Dec 30, 2005 at 06:34 UTC | |
|
Re: Arcitectural considerations with modules
by dragonchild (Archbishop) on Dec 31, 2005 at 21:38 UTC |