#!/usr/bin/perl -w # camel code
use strict;
$_='
eval("seek\040DATA,0,0;"); # clever way of seeking to beginning of program file!
foreach (1..3) { # skip the first 3 lines (shebang, use strict, and a blank line)
;
}
my @camel1hump; # variable def's
my $camel;
my $Camel;
# for each line read, grab the following line (if there is another
# one to read), and go through the individual characters, detecting
# whitespace and nonwhitespace characters.
#
# If you think of the image as being divided into 2x2 character
# blocks, then each char in the block will be assigned a power of
# 2 thusly:
#
# +---+---+
# | 8 | 4 |
# +---+---+
# | 2 | 1 |
# +---+---+
#
# For each block, this while block will add up the corresponding
# numbers for each nonwhiteapce char, resulting in a number stored
# in $camel1hump from 0 to 15. This number will then be translated
# to a ASCII picture character from ' ' (for a value of 0,
# indicating 4 whitespace characters) to 'X' (for a value of 15,
# indicating 4 nonwhitespace chars). These picture chars will be
# stored in the string $camel, to be printed out in a fancy way
# below.
while () {
$_ = sprintf("%-69s", $_); # format string in 69 columns
my @dromedary1 = split(//); # split $_ into individual chars
if (defined($_ = )) { # get next line and split,
@camel1hump=split(//); # if it exists
}
while (@dromedary1) { # for each char
my $camel1hump = 0; # this var will hold the bits
my $CAMEL = 3; # this var is the bit #
if (defined($_ = shift(@dromedary1)) && /\S/) { # if the next char is a nonspace,
$camel1hump += 1<; # slurp in all the program into $_
s/\s*//g; # remove space
( );
;
s;^.*_;;; # remove all characters until the final "_", which will be the last underscore in "__DATA__"
# Now print out the O'Reilly disclaimer. The chars in __DATA__
# are just the ASCII values, coded in octal. (And you thought
# the picture data was there!)
map { # this map statement
eval "print\"$_\""; # prints out each octal character
} # that it finds
/.{4}/g; # using this pattern match.
__DATA__
\124\150\145\040\165\163\145\040\157\146
\040\141\040\143\141\155\145\154\040\151
\155\141\147\145\040\151\156\040\141\163
\163\157\143\151\141\164\151\157\156\040
\167\151\164\150\040\120\145\162\154\040
\151\163\040\141\040\164\162\141\144\145
\155\141\162\153\040\157\146\040\117\047
\122\145\151\154\154\171\040\046\012\101
\163\163\157\143\151\141\164\145\163\054
\040\111\156\143\056\040\125\163\145\144
\040\167\151\164\150\040\160\145\162\155
\151\163\163\151\157\156\056