#!/usr/local/bin/perl -T

use feature ':5.10'; use strict; use warnings; use warnings (FATAL => qw(misc 
numeric uninitialized));

{ package BASE; use Moose;

    sub foo {

        $_[0]->bar;
    }

    sub bar {

        inner();
    }
}

{ package IMPLEMENTS_AUGMENTATION_OF_FOO_BUT_NOT_BAR; use Moose; extends 'BASE';

    augment foo => sub {

        'HUH?';
    };
}

my $obj = IMPLEMENTS_AUGMENTATION_OF_FOO_BUT_NOT_BAR->new;

say $obj->foo; # "HUH?"

===

So $obj->foo prints "HUH?", which is returned by the "augment foo" modifier... 
but "inner" was never called from "foo" in the base class. "inner" was called 
only from "bar", which has no augmentor defined. Granted, "foo" invokes "bar", 
but does "bar" have any business making use of "augment foo" for its own 
"inner"?

(Sorry for all the foo's and bar's.)

TRL

Reply via email to