On Fri, Jun 29, 2001 at 12:14:23AM -0400, Richard J. Barbalace wrote:
> I don't really want to export the variables; I'm not modifying them in
> the parent package, just copying and expanding them in the inheriting
> package.
Well then, you are copying and modifying as simply as it can be done.
> [inherited attributes]
> [get/set accessor methods]
> [regex validation of set]
> [better way?]
I'm not sure about there being a *better* way,
but I'm sure there are a lot of *other* ways.
Various thoughts...
Perl has the concept of tied data items. The basic
operations on those data items, l
Michael Fowler <[EMAIL PROTECTED]> replies:
> Exporting is usually a bad idea when dealing with classes, it breaks
> encapsulation. You should probably setup a class method for this.
>
> That being said, you can export variables just like you export any other
> data type, with Exporter; perldoc
On Thu, Jun 28, 2001 at 03:05:17PM -0400, Richard J. Barbalace wrote:
> The 'use base' pragma nicely takes care of the @ISA and %FIELDS
> variables for me, but I also need to have the package global variable
> %Attributes inherited. The 'use vars' and assignment in MyPackage is
> rather verbose,
Hi.
I feel like I'm asking a lot of questions lately, but this list has
been extremely helpful. :)
I'm writing some packages that inherit from a base class, which has
some fields and some global variables that I want inherited. I have
code like:
# La/De/Da/MyBase.pm
package La::De::Da