Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Motivation for replacing object methods at runtime

by lodin (Hermit)
on Jun 27, 2008 at 20:47 UTC ( #694448=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://694448]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2022-01-20 06:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (56 votes). Check out past polls.

    Notices?