Cet assombrissement est soumis au nom de Paris.pm canal assombri.

OH NO, NOT AGAIN!

Yes, this is a bilingual entry. Or should I say schizophrenic?
Anyway, once again this program is in fact two programs (see below).
For a grand total of 912 bytes, that leaves us with 456 characters for
each of them. Quite below the limit, in fact...

WHAT DOES IT PRINT?

If you run this program with perl it prints a nice ANSI label
(which might remind you of something...)

NO, WHAT DOES IT *REALLY* *PRINT*?

Well, if you send the same file to your PostScript printer (or through
the filter via (echo '%!';cat tpj.pl.ps)|lpr,it will also print a label,
quite similar, though very different...

MORE ON THE PERL SIDE

The Perl banner is encoded in an RLE fashion, the length of the string to
print being encoded as an offset to the character before space (so 1 is
a space). Since it's a two-color banner, the 'current color' is just a matter
of looking at an even/odd counter.

There are 70 spaces in the encoded string, and not much letters (only 'm').
This allowed me to stick a lot of PostScript code into the encoded string,
and to remove the useless characters with a s///.

Here is the original Perl data:
m$  ($*!$"=!$ " ) " * % ? $ " $!" "  !!  !! % !" !"    !!  !""" $ ""! ! !#  !
  !!   %   "   "  !!  !! $ ! $ " !  #! ##  $ ! "   "   "   $ " !#! $ " !   $
 # # $ ! "   "   "   $ " ! ! ! $ " ! !" "#"  #"!"""""! #" " # "m

SHOW ME THE POSTTRICKS!

The first line is usual for lazy Postscript programmers: redefine everything
into something shorter!

;	nothing
#	def (this will be useful to hide PostScript commands in Perl comments)
$_=	font selection (yes, I can redefine almost whatever I want...)
_	relative cursor movement

At the same time, the Perl interpreter sees a match,
followed by rather long comment. Next line, we redefine another
bunch of things:

q	exch (gotta be carful with my Perl quotes!)
x	assignement of the top of the stack to the PostScript variable J
.	assignement of the top of the stack to the PostScript variable T

Then a few symbols that were left on the stack at the end of teh previous
lined are assigned something too:

$   stringwidth
!   nothing
*   nothing too

And we also put an empty 14 character string four times on the stack.

WHERE AM I?

On the Perl side of things, we have another match (with the /x switch),
followed by a block containing another match concatenated with another
block containing yet another match (sorry)...

This last match is quite long, and hides a lot of PostScript code.
This ends with a comment: %/}}; The curly brackets close the two Perl
blocks previously opened...

Perl restarts by assigning the ANSI highligting code to $0. In @ARGV,
we put a lot of letters, which will be used later with the mask.
Then, there's another long quote, until we assign the mask to $_.
Then the mask is purified from the PostScript commands, thanks to a s///.

The next s/// create the sting to print, printing character from the mask
or spaces, depending on the parity of $# (please note that /ee is used:
some Perl code is generated, which uses a lot of pop and concatenation).
The last substitution format the banner to 77 characters wide.

The showpage subroutine is almost a private joke.

BUT WHAT ABOUT THIS %! CODE?

Explanation of the rest of the PostScript code is left as an exercise to
the reader...

IF YOU LOOK AT IT THIS WAY...

This program has a lot to tell. Though Perl and PostScript are very different
in appearance (one if infixed, the other postfixed, one works with lists,
the other with dictionaries...), in this case they performed quite hand in
hand. I must add that PostScript is very well suited for obfuscation even for
novices, thanks to the def operator.

If you look closer at the output of these two programs, you will notice that
the highlighted part, the one that is missing in the output of the Perl
program, is exactly (your screen/eyes/printer resolution may vary) the one
that is printed by the PostScript file. Isn't this come complementarity?
