package Pony;
use strict;

sub new {
    my $referent = shift;

    my $package = join('::', ($referent) x ((rand 10) + 1));
    {
        no strict 'refs';
        *{"$package\::wanna"} = \&wanna;
    }
    bless {}, $package;
}

sub wanna {
    ref $_[0];
}

1;
__END__
