#!/usr/bin/perl -w
#
# Filters text into bork-bork-bork
#
# You send in some text like this little explanation and you'll
# get this:
#
# Yuoo send een sumea text leekea thees leettlea ixplunashun und yuoo'll
# get thees
#
# Pedro Melo <melo@simplicidade.org>
use strict;
use warnings;
use Getopt::Long;
my $help;
my $ok = GetOptions("help|?" => \$help);
usage() if !$ok || $help;
require_module('Lingua::Bork', qw(bork));
print bork($_) while (<>);
#################################
# My little require module method
sub require_module {
my $module = shift;
eval "require $module";
if (my $e = $@) {
print STDERR "FATAL: $0 requires the Perl module '$module'.\n\n";
print STDERR "You can install it with:\n\n";
print STDERR " cpan $module\n\n";
exit(1);
}
$module->import(@_);
}
sub usage {
print STDERR <<USAGE;
Usage: x-bork-bork-bork [--help] [-?] [input files]
Reads the input files, translates them into Bork, Bork, Bork, and sends
the result to stdout.
If no input files are given, it will read from stdin.
USAGE
exit(1);
}