Acme-Buckaroo

 view release on metacpan or  search on metacpan

Buckaroo.pm  view on Meta::CPAN


    my $first           = shift;     # name of module, in this case "Buckaroo.pm"
    my $source_filename = $0;        # name of file called from (if test.pl does a 'use Acme::Buckaroo;' then this will be "test.pl")

    print("Starting \"Buckaroo\" process...\n") if $debug_mode;

    # set up some hashes to go to/from encoding scheme.
    my $i = 0;
    foreach my $this_elem (@xlate_array)
    {
        $xlate_2_hash{$this_elem} = $i;
        $xlate_from_hash{$i}      = $this_elem;
        $i++;
    }

    if (!(open(FILE_HANDLE, "<$source_filename")))
    {
        print("Can't Buckaroo again on '$0'\n");
        exit;
    }
    else
    {
        #comment this out if you don't care.
        print("Past open... ") if $debug_mode;
    }

    #read entire file in as a string.
    my @file_array = <FILE_HANDLE>;
    my $file_array_dump = Dumper(@file_array);
    print("file_array_dump=>>$file_array_dump<<")  if $debug_mode;

    my $file_string = join("",  @file_array);

    # elim anything before the 'use Acme::Buckaroo; line.
    $file_string =~ s/use\s*Acme::Buckaroo\s*;\s*\n//;

    print("Filestring=>>$file_string<<\n")  if $debug_mode;

    # no clue why we do this.  Anyone know?
    #local $SIG{__WARN__} = \&has_wordchars;

    if ( (has_wordchars($file_string)        ) &&
         (!(starts_with_header($file_string))) )
    {
        if (!(open(FILE_HANDLE, ">$0")))
        {
            print("Cannot Buckaroo '$0'\n");
            exit;
        }
        print("past open2...")  if $debug_mode;
        print(FILE_HANDLE "use Acme::Buckaroo;\n");
        my $result = translate($file_string);
        print(FILE_HANDLE $result);
        print("Done \"Buckaroo-ing!\n");
    }
    else
    {
        print("normalizing...\n")  if $debug_mode;
        my $out_string = normalize($file_string);
        print("out_string=>>$out_string<<\n")  if $debug_mode;
        my $outval = eval($out_string);
        print("Outval returned: $outval\n") if $debug_mode;
        if ($@)
        {
            print("Perl Error returned: $@\n");
        }
        print("No eval error returned.\n") if $debug_mode;
    }

    print("Finishing...\n")  if $debug_mode;

    exit;

}

###############################################################################

1;

###############################################################################

__END__

###############################################################################

=head1 NAME

Acme::Buckaroo - Buckaroo Banzai Characters Infest Your Code!

=head1 SYNOPSIS

Before Buckaroo-ing:

use Acme::Buckaroo;

print "Watch 'Buckaroo Banzai Across the 8th Dimension' Today!";

After Bucaroo-ing:

use Acme::Buckaroo;
Buckaroo Banzai Across The Eigth Dimension Buckaroo Banzai Across The Eigth Dimension
Bari Dreiband-Burman    General Catburd George Stokes   Frank James Sparks
        Gary Hellerstein        Glenn Campbell  Buckaroo Banzai Penny Priddy
        Damon Hines     New Jersey      Glenn Campbell  Doreen A. Dixon
        Francine Lembi  Buckaroo Banzai Girl Named John Scooter Lindley
        Gordon Ecker Jr.        Doreen A. Dixon Fred J. Koenekamp       New Jersey
        George Stokes   Gary Hymes      Gary Hymes      Buckaroo Banzai
        Scooter Lindley New Jersey      Gary Hellerstein        Grovers Mills
        New Jersey      Frank James Sparks      Buckaroo Banzai Sandra Banzai
        Doreen A. Dixon George Stokes   Gary Hymes      Gerald Peterson
        Gerald Peterson Buckaroo Banzai Glenn Campbell  Francine Lembi
        Edward Morey    Buckaroo Banzai Perfect Tommy   Glenn Campbell
        Francine Lembi  Buckaroo Banzai Smolensk USSR   Frank James Sparks
        Gary Daigler    Edward Morey    Gary Hellerstein        Gerald Peterson
        Frank James Sparks      Gary Hymes      Gary Hellerstein        Girl Named John
        Buckaroo Banzai Colette Emanuel Gary Hymes      Eddie Marks
        New Jersey      Gregory Jein    Defense Sec. McKinley   Penny Priddy
        Planet 10       Bari Dreiband-Burman

=head1 DESCRIPTION

The first time you run this program, the entire text of the program
after the 'use Acme::Buckaroo;' is converted (character by character)
into characters from the movie "Buckaroo Banzai Across the Eigth
Dimension" (and some other phrases, too).

The program will work (or not!) exactly as it did before it was



( run in 1.064 second using v1.01-cache-2.11-cpan-5a3173703d6 )