Re: Simple OO problem ... Updated

2004-10-09 Thread Randal L. Schwartz
> "Bee" == Bee <[EMAIL PROTECTED]> writes: Bee> use test::Foo; Please name your packages with an initial cap. Lowercase are reserved for pragmas. Bee> return bless $self; You're still needlessly avoiding the two-arg bless, which means your constructors cannot be inherited. Bee> PS. I

Re: Simple OO problem ... Updated

2004-10-08 Thread Bee
# MAIN use test::Foo; my $x = new test::Foo ( 'SunSet', 'myID', 'myPassword' ); my $y = Clone($x); my $z = $y -> Clone; $y->{TEMPLATE} = 'SunRaise'; my $t = 'TEMPLATE'; print $$x{$t} . " " . $$y{$t} . " " . $$z{$t}; # test::Foo package test::Foo; use strict; require Exporter; our @ISA = qw/

Re: Simple OO problem ...

2004-10-08 Thread Bee
> > > > sub copy > > { my $self ; > > This is very confusing code. $self is generally used for the instance > you are acting on. 'copy' is also an odd choice, some prefer 'clone' (if > that is really what you are intending but I can't tell). Yes, I do mean Clone. > > > my $x = shift; > >

Re: Simple OO problem ...

2004-10-08 Thread Wiggins d Anconia
> > # test::load > package test::load; use strict; use warnings; > require Exporter; > our @ISA = qw/Exporter/; > our @EXPORT = qw/new copy/; > > sub copy > { my $self ; This is very confusing code. $self is generally used for the instance you are acting on. 'copy' is also an odd choice, som

Simple OO problem ...

2004-10-08 Thread Bee
# test::load package test::load; require Exporter; our @ISA = qw/Exporter/; our @EXPORT = qw/new copy/; sub copy { my $self ; my $x = shift; my $y = $x -> {B}; $y .= $y; $self -> {YY} = $y; bless $self; return $self; } sub new { my $self; $self -> {A} = shif