The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
#!perl

use strict;
use Test::More tests => 4;

use lib 't/lib';

my $post = '';
use Sub::WrapPackages (
    packages    => [qw(Banana)],
    post         => sub { $post .= $_[0]; },
    wrap_inherited => 1,
);
use Banana;

ok(Banana->peel() eq 'ready to eat', "got right response");
is($post, 'Banana::peel', 'post is good for non-inherited method');

$post = '';
ok(Banana->eat() eq 'yum yum', "got right response");
is($post, 'Banana::eat', 'post is good for inherited method');