Acme-Bushisms
view release on metacpan or search on metacpan
Bushisms.pm view on Meta::CPAN
package Acme::Bushisms;
$VERSION = '0.02';
$arab = " \t"x8;
sub invade { local $_ = unpack "b*", pop; tr/01/ \t/; s/(.{9})/$1\n/g; $arab.$_ }
sub leave { local $_ = pop; s/^$arab|[^ \t]//g; tr/ \t/01/; pack "b*", $_ }
sub oil { $_[0] =~ /\S/ }
sub drill { $_[0] =~ /^$arab/ }
open 0 or print "Can't open '$0'\n" and exit;
$iraq = join "", <0>;
$iraq =~ s/.*^\s*use\s+Acme::Bushisms\s*;\n\n(?:.*?George.*?\n)?//sm;
local $SIG{__WARN__} = \&oil;
do {eval leave $iraq; exit} unless oil $iraq && not drill $iraq;
use LWP::Simple qw($ua get);
$ua ->timeout(10);
$lies = get("http://slate.msn.com/id/76886/");
if (not defined $lies) {
$dubya =<<EOF;
Bushisms.pm view on Meta::CPAN
$bush =~ s/("--|("|'|\s)[^\w\s\r\"\.\']{3,3})/"\n--George W Bush, /ig;
$bush =~ s/[^\w\s\r\"\.\']{3,3}/--/g;
@quotes = $bush =~ /<p>+(\".*?)<p>+/smg;
$dubya = $quotes[rand @quotes];
$dubya = $dubya . "\n--George W Bush"
unless ($dubya =~ /--George/);
}
$dubya =~ s/\s+$//;
open 0, ">$0" or print "Cannot invade '$0'\n" and exit;
print {0} "use Acme::Bushisms;\n\n$dubya\n", invade $iraq and exit;
__END__
=head1 NAME
Acme::Bushisms - Dubya Does Perl
=head1 SYNOPSIS
use Acme::Bushisms;
print "Hello world";
=head1 DESCRIPTION
The first time you run a program under C<use Acme::Bushisms>, the module
removes all the unsightly printable, democrat, and liberal characters from
your source file. The code continues to work exactly as it did before,
but now it contains Bush speak:
use Acme::Bushisms;
"Families is where our nation finds hope, where wings take dream."
--George W Bush, LaCrosse, Wis., Oct. 18, 2000
=head1 NOTES
Acme/Bushisms version 0.02
==========================
NAME
Acme::Bushisms - Dubya Does Perl
DESCRIPTION
The first time you run a program under `use Acme::Bushisms', the
module removes all the unsightly printable, democrat, and liberal
characters from your source file. The code continues to work
exactly as it did before, but now contains Bush speak.
INSTALLATION
It's all pure Perl, so just put the .pm file in its appropriate
local Perl subdirectory
COPYRIGHT AND LICENCE
Copyright (C) 2003 Mike Accardo <mikeaccardo@yahoo.com>
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.pl'
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
use Test;
BEGIN { plan tests => 1 };
use Acme::Bushisms;
ok(1); # If we made it this far, we're ok.
#########################
# Insert your test code below, the Test module is use()ed here so read
# its man page ( perldoc Test ) for help writing this test script.
( run in 0.341 second using v1.01-cache-2.11-cpan-de7293f3b23 )