Perl Hate

Perl is a nice scripting language – no I will not call it a programming language! – you can do so many wonderful things with it. There are no restrictions. Just write some ?!$$'”&%/;$?” and it works. Sure it always works, but you never know what it really does. Like now. If you ever write a perl script you have to support it for the rest of your life. If you want to shoot yourself in the foot with perl, it has already happened.

I am getting an “illegal seek” – nice error. I am reading out a file simple code 5 lines, one loop. Nothing evil. And yet an error keeps coming up. It does not crash the programm but it crashes my error handling!

$matched=0;
eval{
open(file,$file);
	    while($line=<file>){
		#check for match
		if(!$matched){
		    $matched=($line=~/$linematch/);
		}
		#start printing file after match
		else{
		    print STDOUT "$line";
		}
	    }
close(file);
}
if($@){ die "Exception caused while reading $file"; }

What the heck is wrong with this code?