|| Should you ever find yourself writing an obfu and want to make it pretty by formatting the code into a meaningful shape, it's really quite easy.
Create a format file made up of spaces (ASCII 32) and any other character to make your shape. When run, the code will be placed, character for character, in the format you designed. Spaces will remain spaces.
NOTE: This doesn't guarantee that the formatted code will run, but it will make it easier to fine-tune the formatted code.
# Purpose: Format perl source file in a particular shape.
# Run: perl codeformat.pl <perl source> <pattern file>
# SOURCE reads in the perl source code
open SOURCE, $ARGV;
# PATTERN reads in the format text file
open PATTERN, $ARGV;
# make a single string that contains entire source
my $sourceline = join '', <SOURCE>;
# strip out newlines and tabs and create character array,
# reversed for popping.
$sourceline =~ s/\n|\t//g;
my @sourcechars = reverse split //,$sourceline;
my $output = "";
# read in pattern file line by line
# for every non-space (ASCII 32) character
# output the next char of the source string.
while( <PATTERN> )
my @patternchars = split //;
for( $i = 0; $i <= $#patternchars;$i++)
$output .= $patternchars[$i] eq " " ? " " : pop @sourcechars;
$output .= "\n";
# print out the formatted source and any remaining
# source that didn't fit into the pattern.
if( scalar(@sourcechars) > 0 )
print "\n\n",scalar(@sourcechars)," Remaining: \n\n", reverse @sour