geektron has asked for the wisdom of the Perl Monks concerning the following question:
I thought that the call to $obj->SUPER::new() would pass the arg ... and it *sort of* does, because here's the error message:package Unleashed::AuthorizeCard; use strict; use base qw/ Business::OnlinePayment /; sub new { my $class = shift; my $obj = bless( {}, $class ); my $realObj = $obj->SUPER::new( "AuthorizeNet" ); return $realObj; }
i know that i could achive similar results with:[ proton ] :: perl -MUnleashed::AuthorizeCard -e '$foo = Unleashed::Au +thorizeCard->new();' unknown processor AuthorizeNet (syntax error at (eval 2) line 1, near +"use Unleashed::AuthorizeCard=" ) at -e line 1
but i thought ( mistakenly? ) that the call to SUPER would do the same thing .....sub new { my $obj = Business::OnlinePayment->new( "AuthorizeNet" ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: subclass and overridden constructor
by simonm (Vicar) on Dec 03, 2003 at 21:09 UTC | |
by geektron (Curate) on Dec 03, 2003 at 21:15 UTC | |
by simonm (Vicar) on Dec 03, 2003 at 21:28 UTC | |
by geektron (Curate) on Dec 03, 2003 at 22:12 UTC | |
by duff (Parson) on Dec 03, 2003 at 22:24 UTC |