Bart Lateur [EMAIL PROTECTED] writes:
The problem is that you can't safely subclass a class, without examining
it's source, just to make sure that your instance fields don't clash
with any private fields of the mother class.
Well...let's think twice. What has the reputatin of being a bug or
I'm more in favor of a mechanism that makes it easy to build field
names from the package name, for those rare cases where you want
scoped fields. There were discussions about this a couple of years ago
on p5p. For example:
package Foo;
sub new { bless {
On Tue, Aug 08, 2000 at 06:22:03AM +1000, Damian Conway wrote:
I'm more in favor of a mechanism that makes it easy to build field
names from the package name, for those rare cases where you want
scoped fields.
[snip]
See the Tie::Securehash module for a variation on this theme.
Also note
On Mon, Aug 07, 2000 at 01:57:14PM +0200, Jean-Louis Leroy wrote:
package Foo;
sub new
{
bless { "${CURRENT_PACKAGE}name" = 'Simpson' ...
}
...where $CURRENT_PACKAGE is a special variable automatically set
to...guess what? ;-)
Is $CURRENT_PACKAGE any different, value-wise,
2000-08-07-19:22:59 Michael Fowler:
Is $CURRENT_PACKAGE any different, value-wise, than __PACKAGE__?
I'm guessing no, unless I've misunderstood something from the
preceeding discussion.
Is there a reason to prefer it?
I suppose some folks who want to do a truly stunningly huge amount
of this