Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 
avatar of gloomy.penguin

gloomy.penguin

gloomy.penguin has asked 3 questions and find answers to 7 problems.

Stats

175
EtPoint
53
Vote count
3
questions
7
answers

About

.

#!/usr/bin/perl 

package me; 
# brave new world - huxley
# Was and will make me ill. 
# I take a gramme and only am. 

sub exist {
   my $class = shift; 
   bless {'am'=>'kim'}, $class;     
}

sub think {
   my ($self,$thought) = @_;
   $self->{'am'} = 'ill'; 
}

sub take {
   my ($self,$something) = @_;
   $self->{'am'} = undef 
      if ($something =~ /gram(me)?(s)?/i);
}

sub am {
   my $self = shift; 
   print $self->{'am'} 
         if defined $self->{'am'}; 
   print "\n";
} 

my $i = me->exist();  
   $i->think('was');  
   $i->am(); 
   $i->think('will');  
   $i->am(); 
   $i->take('gramme');
   $i->am(); # now nothing