D
Doug Nichols
I have a program where I create an class and pass a hash:
x.pm
package x;
sub new {
my $object = shift;
my $self = ((@_ == 1) ? shift(): { @_ });
return (bless $self, $object);
}
1;
I also have another class y that I would like x to inherit, but I
cannot seem to get the syntax correctly to do all things.
y.pm
package y;
sub new {
my $self = shift;
$self = { MYX => 'HELLO', MYOMY => 'GOODBYE', }
bless $self;
return $self;
}
1;
Can some one give me a hint?
Thanks
dn
x.pm
package x;
sub new {
my $object = shift;
my $self = ((@_ == 1) ? shift(): { @_ });
return (bless $self, $object);
}
1;
I also have another class y that I would like x to inherit, but I
cannot seem to get the syntax correctly to do all things.
y.pm
package y;
sub new {
my $self = shift;
$self = { MYX => 'HELLO', MYOMY => 'GOODBYE', }
bless $self;
return $self;
}
1;
Can some one give me a hint?
Thanks
dn