in reply to can('SUPER::defaults')
You're just attempting to use regular inheritance, which Perl will handle for you quite happily.
Just for kicks:
#!/usr/bin/perl -w use strict; package Base; sub defaults { warn "Doing defaults!\n"; } package Child; @Child::ISA = 'Base'; sub new { bless({}, $_[0]); } package main; my $c = Child->new(); for (qw( SUPER::defaults defaults Base::defaults )) { if (defined( my $sub = $c->can($_) )) { warn "\$c can do $_!\n"; $c->$sub(); } else { warn "\$c cannot do $_.\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: can('SUPER::defaults')
by pike (Monk) on Oct 23, 2001 at 16:14 UTC | |
by demerphq (Chancellor) on Oct 23, 2001 at 16:25 UTC | |
by chromatic (Archbishop) on Oct 23, 2001 at 23:03 UTC | |
by jackdied (Monk) on Oct 24, 2001 at 02:55 UTC |