Thanks for that. It's clear now, and suprising!
It doesn't even matter what package the invocant is blessed into, or even if it's an arbitrary bare word.
use strict;
use warnings FATAL => 'all';
package Base;
sub hello { print __PACKAGE__.": @{[ref $_[0] || $_[0]]}\n"; }
package Kid;
our @ISA = 'Base';
package Main;
sub hello { print __PACKAGE__.": @{[ref $_[0] || $_[0]]}\n"; }
package main;
our @ISA = 'Main';
my $main = bless {};
$main->Kid::hello; # Base: main
$main->hello; # Main: main
__PACKAGE__->hello; # Main: main
BareWord->Kid::hello; # Base: BareWord
|