An old classic, ideal to waste some time with (either playing or deobfuscating ...)

```
#!/usr/bin/perl

use strict;
'cbreak';\$,=\$/;\$/=++\$b+\$b;\$=='8';\$b=\$=
x28;\$*=\$=x2;@!=(qw(4 _ " a 1 1 0 0 ));\$![7]=`clear`
;push(@!,split shift(@!),q 7\$=W8W\$=8\$b eq "j"8W\$=8\$=W8 \$b eq
"l"8W\$=8W!8(\$b eq"k"&&\$_!~/!/)a#W\$=8#\$=W8\$=W#8W\$=#8#!8##a\*8
\$=8p\$=8\$=p        8\$=q8q\$=8p(#.{59})\$=8\$=\$        1q8#q(.{60
})\$=8#\$=\$1        pap(.{60})!8\$![0]++;"\*\$        1\$="8q(.{6
0})!8\$![0]        ++;"\*\$1\$="8(t.*)!8\$b=(l        ength\$1)-6
1;substr(\$        1,0,\$b )."!". substr(\$1,        \$b+1).\$=4x
"gs'"x"c"es'"c"z"gs if'.shift"z"l"just another perl hacker"l
4'SpaceInvaders'.(\$=x12).'domm@zsi.at j=left k=fire l=right'
_'#'x58_("\$*p\$*"x11).\$=x3_\$*.("\$*\$*q"x11).\$=_("p\$*\$*"x11).\$=
x3_(\$=x3).("\$*\$*q"x11)_1_\$b.\$=."W\$b"_'#'x 587);j(split shift
@!,pop@!);a(split shift@!,pop@!);push(@!,split shift@!,pop@!
);\$_=\$a;map{s/\n//g}@!;map{s/v//g}@!;map{s/  //g}@!;&p;sub'j
{\$_=shift;\$a.=m/^1/?("#\$b\$=\$=\$b#\$,"x12):"#".eval( )."#\$,";@_
eval\'s/\'.(shift).\'/\'.(shift).\'/'.pop().';@_&&'.pop().'(
[6]);z(split\$=,\$![4]);x(split\$=,\$![5]);c(split\$=,\$![7]);\$![1
]++;select+(@-,@-,@-,0.05);(\$![2]=\$_)=~s/\$=/ /g;/pW|Wq/&&h('
Game over');\$_!~/p|q/&&h('You saved our planet. Yeah');print
\$![3],\$![2          ];&p}sub h{print \$![          3],shift,"
You killed          \$![0] space invaders          ",\$,;exit}
Notes
• If you have problems with copy&pasting the code, download it from here
• Term::ReadKey is required, as I was to lazy to implement its functionality myself
• There might be some problems with the refresh rate, depending on your hard/software. You could try different values, shouldn't be too hard to find in the code.
• There are no IFs, WHILEs or FORs - as thedamian once said, control structures are for whimps!
• In fact, most of the functions used are array manipulating stuff and regexes (and one or two (three, in fact) evals, of course)
I'll post a solution later this week...

UPDATE: Here is the solution.

```--
#!/usr/bin/perl -w just another perl hacker
print+seek(DATA,\$=*.3,@-)?~~<DATA>:\$:__DATA__
```

Replies are listed 'Best First'.
by rob_au (Abbot) on May 27, 2002 at 00:03 UTC
Excellent work domm++ To my mind though the shape of the code looks more like one of the ghosts from Pacman :-)

To my mind though the shape of the code looks more like one of the ghosts from Pacman

That's intentional and just another level of obfuscation:

Code that looks like Pacman, but is in fact Space Invaders ...

Maybe I should't have given it away in the title of the node, but then...

```--
#!/usr/bin/perl -w just another perl hacker
print+seek(DATA,\$=*.3,@-)?~~<DATA>:\$:__DATA__
```
by Jasper (Chaplain) on May 27, 2002 at 13:00 UTC
# There are no IFs, WHILEs or FORs -

Errr...? I can't spot any whiles, or fors, but...

Or am I being stupid? (as usual)
Damn, your right. There is one if. I'll try to remove it...
```--
#!/usr/bin/perl -w just another perl hacker
print+seek(DATA,\$=*.3,@-)?~~<DATA>:\$:__DATA__
```
by IndyZ (Friar) on May 29, 2002 at 01:21 UTC
++. Just one complaint: It doesn't end if you kill everything!

--
IndyZ
Oh, it,s not that hard to get them all...
```--
#!/usr/bin/perl -w just another perl hacker
print+seek(DATA,\$=*.3,@-)?~~<DATA>:\$:__DATA__
```
I noticed this too (after posting ..)

Sorry for that, but it was working before I formated the code into the Pacman-Ghost-ASCII-art.

I'll update the code soon (together with a Spoiler..)

```--
#!/usr/bin/perl -w just another perl hacker
print+seek(DATA,\$=*.3,@-)?~~<DATA>:\$:__DATA__
```