Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses


by arturo (Vicar)
on Apr 17, 2001 at 20:06 UTC ( #73215=note: print w/ replies, xml ) Need Help??

in reply to

Hm ... thinking back, I'm not clear how one might write this one in an OO fashion ...

package Action; sub new { my $class = shift; my $self = {}; bless $class, $self; $self; } # other methods sub set_nobility { if ($self->{type} eq 'suffer') { $self->{nobility} = $self->{acted_upon) eq 'slings and arrows of out +rageous fortune' ? 1 : .5; } if ($self->{type} eq 'take arms against') { $self->{nobility} = $self->{acted_upon) eq 'a sea of troubles' ? .9 +8 : .2; } } sub nobility { return $self->{nobility}; }

Putting it to use is left as an exercise for the reader ... erm, author.

Philosophy can be made out of anything. Or less -- Jerry A. Fodor

Comment on Re:
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2015-11-26 19:32 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (706 votes), past polls