> "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
# 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/
> >
> > 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;
> >
>
> # 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
# 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