Acme-Cow
view release on metacpan or search on metacpan
my $package = "Acme::Cow::$f";
eval "require $package;";
if (not $@) {
return $package->new();
}
}
if ($f =~ m,/,) {
$full = $f;
} else {
for my $d (split(/$pathsep/, $cowpath)) {
$fn = File::Spec->catfile($d, $f);
if (-f $fn) {
$full = $fn;
last;
} elsif (-f "$fn.cow") {
$full = "$fn.cow";
last;
}
}
if (not $full) {
die "$progname: Could not find $f cow variant!\n";
}
}
return new Acme::Cow(File => $full);
}
sub display_usage {
die <<EOF;
cow{say,think} version $VERSION, (c) 1999-2002 Tony Monroe
Usage: $progname [-bdgpstwy] [-hv?] [-e eyes] [-f cowfile] [-l] [-n]
[-T tongue] [-W wrapcolumn] [message]
$rcs_id
EOF
}
__END__
=pod
=head1 NAME
cow{say,think} - A configurable talking (or thinking) cow
=head1 SYNOPSIS
Usage: $progname [B<-bdgpstwy>] [B<-hv?>] [B<-e> eyes] [B<-f> I<cowfile>]
[B<-l>] [B<-n>] [B<-T> I<tongue>] [B<-W> I<wrapcolumn>] [I<message>]
=head1 DESCRIPTION
generates an ASCII picture of a cow saying something provided by
the user. If run with no arguments, it accepts standard input,
word-wraps the message given at about 40 columns, and prints the
cow saying the given message on standard output.
To aid in the use of arbitrary messages with arbitrary whitespace,
B<-n> option. If it is specified, the given message will not be
word-wrapped. This is possibly useful if you want to make the cow
think or speak in B<figlet(6)>. If B<-n> is specified, there must
not be any command-line arguments left after all the switches have
been processed.
The B<-W> specifies roughly (where the message should be wrapped.
The default is equivalent to invoking with B<-W 40>, i.e. wrap
words at or before the 40th column.
If any command-line arguments are left over after all switches have
been processed, they become the cow's message. The program will
not accept standard input for a message in this case.
There are several provided modes which change the appearance of
the cow depending on its particular emotional/physical state. The
B<-b> option initiates Borg mode; B<-d> causes the cow to appear
dead; B<-g> invokes greedy mode; B<-p> causes a state of paranoia
to come over the cow; B<-s> makes the cow appear thoroughly stoned;
B<-t> yields a tired cow; B<-w> is somewhat the opposite of B<-t>,
and initiates wired mode; B<-y> brings on the cow's youthful
appearance.
The user may specify the B<-e> option to select the appearance of
the cow's eyes, in which case the first two characters of the
argument string I<eyes> will be used. The default eyes are 'oo'.
The tongue is similarly configurable through B<-T>; it must be two
characters and does not appear by default. However, it does appear
in the 'dead' and 'stoned' modes. Any configuration done by B<-e>
and B<-T> will be lost if one of the provided modes is used.
The B<-f> option specifies a particular cow picture file ("cowfile")
to use. If the cowfile spec contains a slash ("/") then it will
be interpreted as a path relative to the current directory.
Otherwise, cowsay will first search C<@INC> for installed cows
under the C<Acme::Cow::> hierarchy, and then search the path
specified in the C<COWPATH> environment variable. To list all
cowfiles installed as modules (in C<@INC>) and on the current
C<COWPATH>, invoke cowsay with the B<-l> switch.
If the program is invoked as cowthink (or any word that has "think"
as a substring) then the cow will think its message instead of
saying it.
If you would like to write your own cow files, please consult
L<Acme::Cow> and the cowfiles provided with the distribution (in
the C<cows> subdirectory).
=head1 WARNINGS
Cow files for cowsay 4 are not compatible with earlier versions;
they must be converted.
The author is not responsible if people are offended or institutionalized
because of the use of this software. (The author is also not
responsible in general, but that's a separate matter.)
=head1 SEE ALSO
perl(1), figlet(6), L<Acme::Cow>
=head1 AUTHOR
Tony Monroe E<lt>tmonroe plus perl at nog dot netE<gt>. Has been called
a freak many times for even thinking of such a piece of software,
let alone writing it.
The following have contributed cow files, directly or indirectly:
Shannon Appel, Jordan K Hubbard, Donald Kubasak, Marshall Kirk
McKusick, Lincoln Myers, David Petrou, Anthony S Polito, Geordan
Rosario, Eric Rowe, Lars Smith, E<lt>pborys at p-soft dot silesia
( run in 0.456 second using v1.01-cache-2.11-cpan-5837b0d9d2c )