Actually, that isn't going to work against all attacks.
In fact, it doesn't even work against the code I posted
yesterday in the thread about virusses. That is because
my virus installs itself in a BEGIN block right below the
first line (it assumes the first line is the she-bang line).
Hence, it gets executed (and does its damage)
your check aborts the program.
(And yeah, putting the BEGIN all the way at the top was
done by design)
The only thing you gained is that you get alarmed as soon
as damage is done - but then it's too late already.