Ola Torstensson <ola@netch.se>
(incorporating one very good idea
by Magnus Bodin <magnus@bodin.org>)

3rd Annual Obfuscated Perl Contest
Category: #3 (best TPJ)

-----------------------------------

Here's a simpler version of the same program:

close STDIN && exec $^X, '-i.ira', $0, $0;
while (<>) { print <<END if $. == 1 } `$^X $0 $0`;
warn unlink(\$0) && "The Perl Journal";
rename '\$0.ira' => "\$0";
END

The program re-invokes itself with the -i flag, then edits itself to become
a (somewhat) straightforward 'print warning and put back the original' program.
Because the warning will refer to the generated program, the line number will
seem wrong. The very good idea I got from Magnus was to make the line
(apparently) referred to in the warning a blank line.

Closing STDIN will only work once, so that's a nice way of detecting that
we're in our first invocation.

The generated program is on lines 7-12, thanks to the bare << on line 6.
The qx at the end of line 6 continues on the last line.

As you've probably noticed, I love using non-standard delimiters for the q//,
qq//, y/// and qx// operators. qq q.iraq (line 4) simply means ".ira", and
lines 7-10 are one big y///s construct (of the form y{SEARCH}yREPLACEys ).
The /s is of course completely redundant.
