Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Inheritence question

Thread Tools

Inheritence question

Doug Nichols
Posts: n/a
I have a program where I create an class and pass a hash:
package x;

sub new {
my $object = shift;
my $self = ((@_ == 1) ? shift(): { @_ });
return (bless $self, $object);

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.
package y;
sub new {
my $self = shift;
$self = { MYX => 'HELLO', MYOMY => 'GOODBYE', }
bless $self;
return $self;

Can some one give me a hint?

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about inheritence Catherine Heathcote Python 5 07-25-2008 04:44 AM
Quick inheritence question Java 8 01-05-2008 09:15 AM
Question about attribute inheritence in XML Schemas using <xsd:extension> Sean Bright XML 2 12-17-2003 11:51 PM
Question about logging and inheritence krzyber Java 1 11-20-2003 08:54 PM
multiple inheritence question Michael C. Starkie C++ 4 08-14-2003 02:36 PM