E
Eric J. Roode
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
To call a method in a class indirectly, you do:
$self->$method(@args);
To call a specific method in the parent class, you do:
$self->SUPER::foo(@args);
How do you delegate to a parent method indirectly? This:
$self->SUPER::$method(@args);
doesn't work -- it reports "Bad name after ::".
Is there a way to do this without eval? I am using AUTOLOAD to generate
simple accessor/mutator methods in my class (table-driven design), and want
to delegate unknown methods to the parent class (since many methods will be
inherited from the parent).
- --
Eric
$_ = reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBPwQA8GPeouIeTNHoEQIBIQCcCLPo8nnh8y9liZ5t/XomMzkTk90An2Bj
kfso0B0KoynkEUulLEh3JTKr
=CGuJ
-----END PGP SIGNATURE-----
Hash: SHA1
To call a method in a class indirectly, you do:
$self->$method(@args);
To call a specific method in the parent class, you do:
$self->SUPER::foo(@args);
How do you delegate to a parent method indirectly? This:
$self->SUPER::$method(@args);
doesn't work -- it reports "Bad name after ::".
Is there a way to do this without eval? I am using AUTOLOAD to generate
simple accessor/mutator methods in my class (table-driven design), and want
to delegate unknown methods to the parent class (since many methods will be
inherited from the parent).
- --
Eric
$_ = reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBPwQA8GPeouIeTNHoEQIBIQCcCLPo8nnh8y9liZ5t/XomMzkTk90An2Bj
kfso0B0KoynkEUulLEh3JTKr
=CGuJ
-----END PGP SIGNATURE-----