I haven't (and won't) have time to go into this in detail :-(

I feel that this proposal is solving the wrong problem. The issue is
that the original Forest and Frog (or DBI and DBI::st) classes are not
*designed* for user-definable Frogs (DBI::st's). If that functionality
is widely needed, the Forest should be redesigned with *configurable*
Frogs.

But even if you can't redesign the forest, Perl still makes it easy to
impose a Japanese accent on Frogs wherever you need to:

        my $forest = Forest->new();

        if (can_see_Mt_Fuji()) {
                local *Frog::speak = sub { "kerokero" };
                # or:
                # local *Frog::speak = \&Frog::Japanese::speak;

                print $forest->make_noise();    # "kerokero"
        }

        print $forest->make_noise();            # "ribbit-ribbit"

Damian

Reply via email to