The "::" makes it look like a procedural interface call, but it is a bona fide OO method call, with an implicit instance (or package name) as first argument and all; a rather different animal from the similar-looking (and wrong) Grandpa::hello().
I think that:
$me->Grandpa::hello()
is the same as:
Grandpa::hello($me);
which isn't OO. You can test it like so:
use strict; package other; sub hello { print "otherwise @{[ref shift]}\n"; } package Grandpa; sub hello { my $class = ref $_[0] || $_[0]; print "How do you do, from $class.\n"; } package Dad; our @ISA = 'Grandpa'; sub hello { my $class = ref $_[0] || $_[0]; print "Hiya from $class!\n"; } package Me; our @ISA = 'Dad'; sub new { bless {} } sub hello { print "hello\n"; } package main; my $me = bless {}, 'Me'; # look Ma, no constructor! $me->Grandpa::hello; $me->other::hello; __END__ How do you do, from Me. otherwise Me
hth
In reply to Re: Skipping the middle man & the SUPER gotcha
by Thelonious
in thread Skipping the middle man & the SUPER gotcha
by tlm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |