Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked


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

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 perusing the Monastery: (10)
As of 2016-10-26 10:55 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (340 votes). Check out past polls.