Acme-Meow

 view release on metacpan or  search on metacpan

lib/Acme/Meow.pm  view on Meta::CPAN

package Acme::Meow;

use warnings;
use strict;

require Exporter;
use base qw[ Exporter ];
=head1 NAME

Acme::Meow - It's the kitty you've always wanted

=head1 VERSION

Version 0.01 - please note this is a preview release, the API may change
$Id: Meow.pm 558 2007-09-07 12:14:11Z f00li5h $
=cut

our $VERSION = '0.01';
=head1 SYNOPSIS

This module is intended for use by folks who's leases
specify that they are not allowed to have any pets

    use Acme::Meow;

    my $kitty = Acme::Meow->new();
    $kitty->pet();
    $kitty->feed();


=head1 FUNCTIONS

=head2 new - kitty constructor

Currently only abstract kitties are available so no options are available,
although they may be added in the future.

This method will take a hashref of options as required.

=cut 

sub new {
    bless{},shift
}

=head1 METHODS

=head2 pet - pet the kitty

=cut

our @snacks = qw[ milk nip ];

sub pet {
    my($kitty) =@_;

    my @reactions = qw[ purr nuzzle meow ];

    $kitty->{'<3'} ++;
    $kitty->{'favs'} = {
        snack => @snacks[ rand @snacks ]
    };

    print $kitty->_kitty_status,
          $reactions[ rand @reactions ], $kitty->{'<3'} > 15 ? '<3' : '' 
     

}


=head2 feed - give the kitty a snack

the kitty does need to eat, otherwise it will get unhealthy

=cut

sub feed {

    my($kitty) =@_;

    my @reactions = ( 'crunch', 'lap lap', '');

    if (!$kitty->is_sleeping()){
        $kitty->{'^_^'} ++; 
        $kitty->{'<3' } += 0.5;
    }
    else {
        $kitty->{'^_^'} -= 0.5; 
        $kitty->{'<3' } += 0.25;
    }

    print $kitty->_kitty_status,
        $reactions[ rand @reactions ];

}

=head1 EXPORTS

by default this package exports some methods for playing with your 
kitties.

=head2 milk - give milk to a kitty.



( run in 2.249 seconds using v1.01-cache-2.11-cpan-5a3173703d6 )