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

Re: myQuestion.pl

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


in reply to myQuestion.pl

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: myQuestion.pl
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (11)
As of 2015-07-08 07:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (96 votes), past polls