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


Acme-Meow documentation Contained in the Acme-Meow distribution.

Index


Code Index:

NAME

Top

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

VERSION

Top

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

SYNOPSIS

Top

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();




FUNCTIONS

Top

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.

METHODS

Top

pet - pet the kitty

feed - give the kitty a snack

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

EXPORTS

Top

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

milk - give milk to a kitty.

if not called directly on a kitty, $_ will be checked for a kitty;

nip - give nip to a kitty.

if not called directly on a kitty, $_ will be checked for a kitty;

is_sleeping

This method will tell you if your kitty is having a cat nap. Kittens may be very cranky during their nap time, and waking them may be a bad idea.

_kitty_status

private

AUTHOR

Top

FOOLISH, <foolish at cpan.org>

BUGS

Top

Please report any bugs or feature requests to bug-acme-meow at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Acme-Meow. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

TODO

Top

play

it'd be nince to play games with the kitty too

    $kitty->play( 'game' ); 

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Acme::Meow

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Acme-Meow

* CPAN Ratings

http://cpanratings.perl.org/d/Acme-Meow

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Acme-Meow

* Search CPAN

http://search.cpan.org/dist/Acme-Meow

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top


Acme-Meow documentation Contained in the Acme-Meow distribution.
package Acme::Meow;

use warnings;
use strict;

require Exporter;
use base qw[ Exporter ];
our $VERSION = '0.01';
sub new {
    bless{},shift
}

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' : '' 
     

}


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 ];

}

our @EXPORT    = qw(&milk &nip);   # afunc is a function
# @EXPORT_OK = qw(&%hash *typeglob); # explicit prefix on &bfunc

sub milk {
    my $kitty;

    if(not @_ and ref $_ eq __PACKAGE__){
        $kitty = $_
    }
    if( @_ ){ $kitty = shift }

    $kitty->feed( 'milk' );
}

sub nip {

    my $kitty;

    if(not @_ and ref $_ eq __PACKAGE__){
        $kitty = $_
    }
    if( @_ ){ $kitty = shift }

    $kitty->feed( 'nip' );

}


sub is_sleeping {

    my($kitty) =@_;
    0; #TODO: our kitties are currently insomniacs
}

sub _kitty_status {

    my($kitty) =@_;
    return 'zZzZ' if $kitty->is_sleeping();
    $kitty->{'<3'} > 5 ? '=-_-=' : '=^_^=';

}

1; # End of Acme::Meow