http://qs321.pair.com?node_id=694448


in reply to Motivation for replacing object methods at runtime

If Perl had better support for anonymous classes a simple solution would be to just create a specialization of the Divisor class (i.e. a subclass).

# Pseudo code! my $two = new subclass of Divisor { sub divides { $_[1] =~ /[02468]\z/ } };
There would be no need to modify or redefine anything in the Divisor class.

lodin